[Finder] Fixed randomly failing tests due to the order files are read from the filesystem
This commit is contained in:
parent
1719bfb871
commit
26e4b2e2ef
@ -205,14 +205,21 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
$dirs[] = (string) $dir;
|
$dirs[] = (string) $dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals($this->toAbsolute(array('foo', 'toto')), $dirs, 'implements the \IteratorAggregate interface');
|
$expected = $this->toAbsolute(array('foo', 'toto'));
|
||||||
|
|
||||||
|
sort($dirs);
|
||||||
|
sort($expected);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $dirs, 'implements the \IteratorAggregate interface');
|
||||||
|
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$this->assertEquals(2, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
|
$this->assertEquals(2, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
|
||||||
|
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
|
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
|
||||||
$this->assertEquals($this->toAbsolute(array('foo', 'toto')), array_values(array_map(function ($a) { return (string) $a; }, $a)), 'implements the \IteratorAggregate interface');
|
$a = array_values(array_map(function ($a) { return (string) $a; }, $a));
|
||||||
|
sort($a);
|
||||||
|
$this->assertEquals($expected, $a, 'implements the \IteratorAggregate interface');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function toAbsolute($files)
|
protected function toAbsolute($files)
|
||||||
|
Reference in New Issue
Block a user