Skip to content

Commit

Permalink
fix sort
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 26, 2021
1 parent 44aaeeb commit d1d7df5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/ConfigTest.php
Expand Up @@ -128,7 +128,9 @@ public function testThatFinderWorksWithDirSetOnConfig()
);

static::assertCount(3, $items);
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a, $b); });
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) {
return strcmp($a->getFilename(), $b->getFilename());
});
static::assertSame('.php_cs', $items[0]->getFilename());
static::assertSame('.php_cs.dist', $items[1]->getFilename());
static::assertSame('somefile.php', $items[2]->getFilename());
Expand All @@ -147,7 +149,9 @@ public function testThatCustomFinderWorks()
);

static::assertCount(3, $items);
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a, $b); });
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) {
return strcmp($a->getFilename(), $b->getFilename());
});
static::assertSame('.php_cs', $items[0]->getFilename());
static::assertSame('.php_cs.dist', $items[1]->getFilename());
static::assertSame('somefile.php', $items[2]->getFilename());
Expand All @@ -166,7 +170,9 @@ public function testThatCustomSymfonyFinderWorks()
);

static::assertCount(2, $items);
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a, $b); });
usort($items, function (\SplFileInfo $a, \SplFileInfo $b) {
return strcmp($a->getFilename(), $b->getFilename());
});
static::assertSame('somefile.php', $items[0]->getFilename());
static::assertSame('somefile2.php.txt', $items[1]->getFilename());
}
Expand Down

0 comments on commit d1d7df5

Please sign in to comment.