mirror of
https://github.com/adlawson/php-vfs.git
synced 2024-11-26 23:06:40 +00:00
Merge pull request #18 from igrizzli/develop
Readdir infinity reading fix
This commit is contained in:
commit
610649d759
@ -84,6 +84,8 @@ class DirectoryHandle extends AbstractHandle
|
|||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function write($content)
|
public function write($content)
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
namespace Vfs\Stream\StreamWrapper;
|
||||||
|
|
||||||
|
use Vfs\Test\AcceptanceTestCase;
|
||||||
|
|
||||||
|
class ReadDirAcceptanceTest extends AcceptanceTestCase
|
||||||
|
{
|
||||||
|
protected $tree = [
|
||||||
|
'foo' => [
|
||||||
|
'bar' => 'baz'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
public function testReadDirectory()
|
||||||
|
{
|
||||||
|
$dHandler = opendir("$this->scheme:///foo");
|
||||||
|
$expects = ['bar' => true, '.' => true, '..' => true];
|
||||||
|
while(($file = readdir($dHandler)) !== false) {
|
||||||
|
$this->assertArrayHasKey($file, $expects);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user