8000 actually compare the order of entries when any sorting is applied · symfony/symfony@df476b8 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df476b8

Browse files
committed
actually compare the order of entries when any sorting is applied
1 parent 04671ee commit df476b8

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Symfony/Component/Finder/Tests/FinderTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public function testSortByName()
631631
{
632632
$finder = $this->buildFinder();
633633
$this->assertSame($finder, $finder->sortByName());
634-
$this->assertIterator($this->toAbsolute([
634+
$this->assertOrderedIterator($this->toAbsolute([
635635
'foo',
636636
'foo bar',
637637
'foo/bar.tmp',
@@ -654,14 +654,12 @@ public function testSortByType()
654654
{
655655
$finder = $this->buildFinder();
656656
$this->assertSame($finder, $finder->sortByType());
657-
$this->assertIterator($this->toAbsolute([
657+
$this->assertOrderedIterator($this->toAbsolute([
658658
'foo',
659-
'foo bar',
659+
'qux',
660660
'toto',
661+
'foo bar',
661662
'foo/bar.tmp',
662-
'test.php',
663-
'test.py',
664-
'qux',
665663
'qux/baz_100_1.py',
666664
'qux/baz_1_2.py',
667665
'qux_0_1.php',
@@ -670,14 +668,16 @@ public function testSortByType()
670668
'qux_10_2.php',
671669
'qux_12_0.php',
672670
'qux_2_0.php',
671+
'test.php',
672+
'test.py',
673673
]), $finder->in(self::$tmpDir)->getIterator());
674674
}
675675

676676
public function testSortByAccessedTime()
677677
{
678678
$finder = $this->buildFinder();
679679
$this->assertSame($finder, $finder->sortByAccessedTime());
680-
$this->assertIterator($this->toAbsolute([
680+
$this->assertOrderedIterator($this->toAbsolute([
681681
'foo/bar.tmp',
682682
'test.php',
683683
'toto',
@@ -700,7 +700,7 @@ public function testSortByChangedTime()
700700
{
701701
$finder = $this->buildFinder();
702702
$this->assertSame($finder, $finder->sortByChangedTime());
703-
$this->assertIterator($this->toAbsolute([
703+
$this->assertOrderedIterator($this->toAbsolute([
704704
'toto',
705705
'test.py',
706706
'test.php',
@@ -723,7 +723,7 @@ public function testSortByModifiedTime()
723723
{
724724
$finder = $this->buildFinder();
725725
$this->assertSame($finder, $finder->sortByModifiedTime());
726-
$this->assertIterator($this->toAbsolute([
726+
$this->assertOrderedIterator($this->toAbsolute([
727727
'foo/bar.tmp',
728728
'test.php',
729729
'toto',
@@ -770,27 +770,27 @@ public function testSortByNameNatural()
770770
{
771771
$finder = $this->buildFinder();
772772
$this->assertSame($finder, $finder->sortByName(true));
773-
$this->assertIterator($this->toAbsolute([
773+
$this->assertOrderedIterator($this->toAbsolute([
774774
'foo',
775-
'foo bar',
776775
'foo/bar.tmp',
776+
'foo bar',
777777
'qux',
778-
'qux/baz_100_1.py',
779778
'qux/baz_1_2.py',
779+
'qux/baz_100_1.py',
780780
'qux_0_1.php',
781-
'qux_1000_1.php',
782-
'qux_1002_0.php',
781+
'qux_2_0.php',
783782
'qux_10_2.php',
784783
'qux_12_0.php',
785-
'qux_2_0.php',
784+
'qux_1000_1.php',
785+
'qux_1002_0.php',
786786
'test.php',
787787
'test.py',
788788
'toto',
789789
]), $finder->in(self::$tmpDir)->getIterator());
790790

791791
$finder = $this->buildFinder();
792792
$this->assertSame($finder, $finder->sortByName(false));
793-
$this->assertIterator($this->toAbsolute([
793+
$this->assertOrderedIterator($this->toAbsolute([
794794
'foo',
795795
'foo bar',
796796
'foo/bar.tmp',
@@ -813,13 +813,10 @@ public function testSort()
813813
{
814814
$finder = $this->buildFinder();
815815
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }));
816-
$this->assertIterator($this->toAbsolute([
816+
$this->assertOrderedIterator($this->toAbsolute([
817817
'foo',
818818
'foo bar',
819819
'foo/bar.tmp',
820-
'test.php',
821-
'test.py',
822-
'toto',
823820
'qux',
824821
'qux/baz_100_1.py',
825822
'qux/baz_1_2.py',
@@ -829,6 +826,9 @@ public function testSort()
829826
'qux_10_2.php',
830827
'qux_12_0.php',
831828
'qux_2_0.php',
829+
'test.php',
830+
'test.py',
831+
'toto',
832832
]), $finder->in(self::$tmpDir)->getIterator());
833833
}
834834

0 commit comments

Comments
 (0)
0