12 namespace Symfony\Component\Finder\Tests\Iterator;
20 $values = array_map(
function (\
SplFileInfo $fileinfo) {
return str_replace(
'/', DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator,
false));
22 $expected = array_map(
function ($path) {
return str_replace(
'/', DIRECTORY_SEPARATOR, $path); }, $expected);
27 $this->assertEquals($expected, array_values($values));
32 $values = array_map(
function (\
SplFileInfo $fileinfo) {
return $fileinfo->getPathname(); }, iterator_to_array($iterator));
34 $this->assertEquals($expected, array_values($values));
49 $values = array_values(array_map(
function (\
SplFileInfo $fileinfo) {
return $fileinfo->getPathname(); }, iterator_to_array($iterator)));
51 foreach ($expected as $subarray) {
53 while (count($values) && count($temp) < count($subarray)) {
54 $temp[] = array_shift($values);
58 $this->assertEquals($subarray, $temp);
71 foreach ($iterator as $file) {
72 $this->assertInstanceOf(
'Symfony\\Component\\Finder\\SplFileInfo', $file);
73 $values[] = $file->getPathname();
79 $this->assertEquals($expected, array_values($values));
91 foreach ($iterator as $file) {
92 $this->assertInstanceOf(
'Symfony\\Component\\Finder\\SplFileInfo', $file);
93 $values[] = $file->getPathname();
96 $this->assertEquals($expected, array_values($values));