Skip to content

Commit

Permalink
test for DevFilesFinder::getFilteredEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Mar 15, 2020
1 parent ff68bac commit aff2836
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/DevFilesFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@

class DevFilesFinderTest extends TestCase
{
/**
* @var string[]
*/
private $simpleEntriesArray = [
'/src/file.php',
'/src/File.php',
'/src/FILE.PHP',
'/tests/test.php',
'/tests/Test.php',
'/tests/TEST.PHP',
'/tests/test.docx',
'/tests/Test.docx',
'/tests/TEST.DOCX',
];

public function testGetGlobPatternsForPackage()
{
Expand Down Expand Up @@ -61,4 +75,25 @@ public function testGetGlobPatternsForPackage()
);
}

public function testGetFilteredEntries()
{
$patterns = [
'/tests/**',
];

$devFiles = [];
$devFilesFinder = new DevFilesFinder($devFiles, false);
self::assertEquals(
[
'/tests/test.php',
'/tests/test.docx',
'/tests/Test.php',
'/tests/Test.docx',
'/tests/TEST.PHP',
'/tests/TEST.DOCX',
],
$devFilesFinder->getFilteredEntries($this->simpleEntriesArray, $patterns)
);
}

}

0 comments on commit aff2836

Please sign in to comment.