Skip to content

Commit

Permalink
Add failing test for include not superseding excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Feb 21, 2020
1 parent 0430124 commit 4d5f46c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/allejo/stakx/Test/Filesystem/FileExplorerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,36 @@ public function testCustomTimestampMatcher()
$this->assertNotContains($file->getFilename(), 'old');
}
}

public function testIncludesSupercedesExcludes()
{
vfsStream::create([
'dist' => [
'css' => [
'styles.css' => '',
],
'images' => [
'image1.png' => '',
'image2.png' => '',
],
'js' => [
'main.js' => '',
],
'index.html' => '',
'about.html' => '',
],
]);

$explorer = FileExplorer::create($this->rootDir->url(), ['/dist\/(css|images|js)\/.+/'], ['dist'])->getFileIterator();
$blacklist = ['index.html', 'about.html'];
$fileCount = 0;

/** @var File $file */
foreach ($explorer as $file) {
++$fileCount;
$this->assertNotContains($blacklist, $file->getFilename());
}

$this->assertEquals(4, $fileCount);
}
}

0 comments on commit 4d5f46c

Please sign in to comment.