[TYPO3-50-general] vfsstream
Christoph Blömer
chbloemer at gmx.net
Mon Feb 16 22:26:24 CET 2009
Hi,
the vfsstream project has been updated and this bug should have been
fixed with r83.
http://code.google.com/p/bovigo/issues/detail?id=4
You can now iterate over a directory more than once.
Please update the files in the flow3/phpunit repository.
Greetings
Christoph
Christoph Blömer schrieb:
> Hello,
> last night I was writing a unit test for my Virtual File System package.
> I wanted to navigate through the filesystem and check if the correct
> folders and files can be retrieved.
> But the tests always failed. A little later i noticed that if files were
> read once they a removed from the vfsstream.
> This is a test I wrote to verify the behaviour.
> $this->url1 is the root of the vfsstream root.
> If it is a normal filesystem the test works.
> count($list2) is always 0!!!
>
> /**
> * @test
> */
> public function vfsstream(){
>
> $dir = $this->url1;
> $list1 = array();
> if ($handle = opendir($dir)) {
> while (false !== ($listItem = readdir($handle))) {
> if ($listItem != "." && $listItem != "..") {
> if(is_file($dir.'/'.$listItem)) {
> $list1[] = "File:[".$listItem."]";
> } else if(is_dir($dir.'/'.$listItem)) {
> $list1[] = "Folder:[".$listItem."]";
> }
> }
> }
> closedir($handle);
> }
>
> $list2 = array();
> if ($handle = opendir($dir)) {
> while (false !== ($listItem = readdir($handle))) {
> if ($listItem != "." && $listItem != "..") {
> if(is_file($dir.'/'.$listItem)) {
> $list2[] = "File:[".$listItem."]";
> } else if(is_dir($dir.'/'.$listItem)) {
> $list2[] = "Folder:[".$listItem."]";
> }
> }
> }
> closedir($handle);
> }
> $this->assertEquals(count($list1), count($list2));
> }
>
> Any ideas what's wrong or how to prevent this problem?
>
> Greetings
> Christoph
> _______________________________________________
> TYPO3-project-5_0-general mailing list
> TYPO3-project-5_0-general at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-5_0-general
>
>
More information about the TYPO3-project-5_0-general
mailing list