Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  harden test to not depend on the actual time
  [ProxyManager] fix tests
  actually compare the order of entries when any sorting is applied
  • Loading branch information
xabbuh committed Jan 4, 2021
2 parents 511c62f + fbd34cd commit 9e322de
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Tests/FinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ public function testSortByName()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByName());
$this->assertIterator($this->toAbsolute([
$this->assertOrderedIterator($this->toAbsolute([
'foo',
'foo bar',
'foo/bar.tmp',
Expand All @@ -654,14 +654,12 @@ public function testSortByType()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByType());
$this->assertIterator($this->toAbsolute([
$this->assertOrderedIterator($this->toAbsolute([
'foo',
'foo bar',
'qux',
'toto',
'foo bar',
'foo/bar.tmp',
'test.php',
'test.py',
'qux',
'qux/baz_100_1.py',
'qux/baz_1_2.py',
'qux_0_1.php',
Expand All @@ -670,6 +668,8 @@ public function testSortByType()
'qux_10_2.php',
'qux_12_0.php',
'qux_2_0.php',
'test.php',
'test.py',
]), $finder->in(self::$tmpDir)->getIterator());
}

Expand Down Expand Up @@ -770,27 +770,27 @@ public function testSortByNameNatural()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByName(true));
$this->assertIterator($this->toAbsolute([
$this->assertOrderedIterator($this->toAbsolute([
'foo',
'foo bar',
'foo/bar.tmp',
'foo bar',
'qux',
'qux/baz_100_1.py',
'qux/baz_1_2.py',
'qux/baz_100_1.py',
'qux_0_1.php',
'qux_1000_1.php',
'qux_1002_0.php',
'qux_2_0.php',
'qux_10_2.php',
'qux_12_0.php',
'qux_2_0.php',
'qux_1000_1.php',
'qux_1002_0.php',
'test.php',
'test.py',
'toto',
]), $finder->in(self::$tmpDir)->getIterator());

$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByName(false));
$this->assertIterator($this->toAbsolute([
$this->assertOrderedIterator($this->toAbsolute([
'foo',
'foo bar',
'foo/bar.tmp',
Expand All @@ -813,13 +813,10 @@ public function testSort()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }));
$this->assertIterator($this->toAbsolute([
$this->assertOrderedIterator($this->toAbsolute([
'foo',
'foo bar',
'foo/bar.tmp',
'test.php',
'test.py',
'toto',
'qux',
'qux/baz_100_1.py',
'qux/baz_1_2.py',
Expand All @@ -829,6 +826,9 @@ public function testSort()
'qux_10_2.php',
'qux_12_0.php',
'qux_2_0.php',
'test.php',
'test.py',
'toto',
]), $finder->in(self::$tmpDir)->getIterator());
}

Expand Down

0 comments on commit 9e322de

Please sign in to comment.