Skip to content

Commit

Permalink
Expands the PHP preset
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed Nov 2, 2024
1 parent 7563baa commit b9ee0e1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Presets/PhpPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function getPresetGlob(): array
'*.txt',
'*.rst',
'*.{md,MD}',
'*.{png,gif,jpeg,jpg,webp}',
'*.xml',
'*.yml',
'phpunit*',
Expand Down
32 changes: 32 additions & 0 deletions tests/AnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,37 @@ public function presentGitignoredSpecsCoverageDirectoryIsExcludedFromValidation(
$this->assertTrue($analyser->hasCompleteExportIgnores());
}

#[Test]
public function exportIgnoresExpectedImages(): void
{
$artifactFilenames = [
'test.png',
'test.gif',
'test.jpg',
'test.jpeg',
'test.webp',
];

$this->createTemporaryFiles(
$artifactFilenames
);

$gitattributesContent = <<<CONTENT
.gitattributes export-ignore
test.gif export-ignore
test.jpeg export-ignore
test.jpg export-ignore
test.png export-ignore
test.webp export-ignore
CONTENT;

$this->createTemporaryGitattributesFile($gitattributesContent);

$analyser = (new Analyser(new Finder(new PhpPreset())))->setDirectory($this->temporaryDirectory);
$this->assertTrue($analyser->hasCompleteExportIgnores());
}

#[Test]
#[Group('glob')]
public function returnsExpectedDefaultGlobPatterns(): void
Expand All @@ -1394,6 +1425,7 @@ public function returnsExpectedDefaultGlobPatterns(): void
'*.txt',
'*.rst',
'*.{md,MD}',
'*.{png,gif,jpeg,jpg,webp}',
'*.xml',
'*.yml',
'phpunit*',
Expand Down
1 change: 1 addition & 0 deletions tests/Commands/InitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function createsExpectedDefaultLpvFile(): void
*.txt
*.rst
*.{md,MD}
*.{png,gif,jpeg,jpg,webp}
*.xml
*.yml
phpunit*
Expand Down

0 comments on commit b9ee0e1

Please sign in to comment.