[Cs-content-commits] SF.net SVN: cs-content:[460] trunk/1.0/tests/testOfCSFileSystem.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-09-15 22:15:10
|
Revision: 460 http://cs-content.svn.sourceforge.net/cs-content/?rev=460&view=rev Author: crazedsanity Date: 2009-09-15 20:53:51 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Make sure file reading/writing tests ONLY work with files (not folders). Modified Paths: -------------- trunk/1.0/tests/testOfCSFileSystem.php Modified: trunk/1.0/tests/testOfCSFileSystem.php =================================================================== --- trunk/1.0/tests/testOfCSFileSystem.php 2009-09-15 20:28:18 UTC (rev 459) +++ trunk/1.0/tests/testOfCSFileSystem.php 2009-09-15 20:53:51 UTC (rev 460) @@ -67,16 +67,24 @@ //okay, read all the files & make the writer create them. $matchSize = array(); foreach($insideLs as $file=>$data) { - $this->assertEqual(1, $this->writer->create_file($file)); - - $this->assertNotEqual($this->writer->realcwd, $this->reader->realcwd); - - //now read data out of one & write into the other, make sure they're the same size. - $fileSize = $this->writer->write($this->reader->read($file), $file); - $this->assertEqual($fileSize, $data['size']); - - //now get rid of the new file. - $this->writer->rm($file); + if($data['type'] == 'file') { + $this->assertEqual(1, $this->writer->create_file($file)); + + $this->assertNotEqual($this->writer->realcwd, $this->reader->realcwd); + + //now read data out of one & write into the other, make sure they're the same size. + $fileSize = $this->writer->write($this->reader->read($file), $file); + if(!$this->assertEqual($fileSize, $data['size'], "Invalid file size for '". $file ."' (". $fileSize ." != ". $data['size'] .")")) { + $this->gfObj->debug_print($this->writer->ls($file)); + $this->gfObj->debug_print($this->reader->ls($file)); + + $this->gfObj->debug_print($this->writer); + $this->gfObj->debug_print($this->reader); + } + + //now get rid of the new file. + $this->writer->rm($file); + } } //lets take the contents of ALL of those files, push it into one big file, and make sure it is identical. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |