mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-05 10:55:33 +01:00
Remove files that are ignored before they are generated
This commit is contained in:
parent
a56d9b2d5e
commit
f0121f8bc6
2 changed files with 59 additions and 0 deletions
25
tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php
Normal file
25
tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use App\Command\RemoveIgnoredFilesCommand;
|
||||
use App\DataTransferObject\TemplateFile;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
class RemoveIgnoredFilesCommandTest extends KernelTestCase
|
||||
{
|
||||
public function test_it_removes_any_ignored_files(): void
|
||||
{
|
||||
$filenamesToGenerate = [
|
||||
new TemplateFile(data: '', name: 'phpcs.xml.dist'),
|
||||
new TemplateFile(data: '', name: 'phpstan.neon.dist'),
|
||||
];
|
||||
|
||||
$filenamesToIgnore = ['phpstan.neon.dist'];
|
||||
|
||||
$command = new RemoveIgnoredFilesCommand($filenamesToIgnore);
|
||||
|
||||
$command->execute([[], [], $filenamesToGenerate], function ($result) {
|
||||
self::assertCount(1, $result[1]);
|
||||
self::assertSame('phpcs.xml.dist', $result[1][0]->name);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue