Skip to content

Commit

Permalink
Use a consistent file order for the fs provider, independent from fs
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Jun 17, 2021
1 parent 324c8d2 commit 4d87d57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Provider/LocalFilesystemProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private function files(): Finder
->exclude($excludedDirs)
->notPath(array_map(fn ($exclude) => $this->convertPattern($exclude), $excludedPatterns))
->path(array_map(fn ($pattern) => $this->convertPattern($pattern), $this->patterns))
->sortByName()
;

if ($this->depth) {
Expand Down
16 changes: 8 additions & 8 deletions tests/Integration/Command/DebugCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function provide testList data(): iterable
{
yield 'list' => [Author::class,
<<<TXT
* tom32i
* john.doe
* ogi
* tom32i
TXT
];

Expand Down Expand Up @@ -89,22 +89,22 @@ public function provide testList data(): iterable

yield 'filter property (data prefix)' => [Author::class,
<<<TXT
* tom32i
* ogi
* tom32i
TXT
, ['_.core'], ];

yield 'filter property (d prefix)' => [Author::class,
<<<TXT
* tom32i
* ogi
* tom32i
TXT
, ['d.core'], ];

yield 'filter property (_ prefix)' => [Author::class,
<<<TXT
* tom32i
* ogi
* tom32i
TXT
, ['_.core'], ];

Expand All @@ -122,24 +122,24 @@ public function provide testList data(): iterable

yield 'filter contains' => [Author::class,
<<<TXT
* tom32i
* ogi
* tom32i
TXT
, ['contains(_.slug, "i")'], ];

yield 'filter dates' => [Recipe::class,
<<<TXT
* tomiritsu
* ogito
* tomiritsu
TXT
, ['_.date > date("2019-01-01") and _.date < date("2020-01-01")'], ];

yield 'filter and order' => [Author::class,
<<<TXT
* ogi
* tom32i
* ogi
TXT
, ['_.core'], ['slug'], ];
, ['_.core'], ['desc:slug'], ];

yield 'multiple filters' => [Author::class,
<<<TXT
Expand Down

0 comments on commit 4d87d57

Please sign in to comment.