Skip to content

Commit

Permalink
PHP Linting (Pint)
Browse files Browse the repository at this point in the history
  • Loading branch information
SRWieZ authored and github-actions[bot] committed Oct 31, 2023
1 parent dc22bd4 commit 52b5d0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/svgtinyps.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function showHelp()
echo 'Usage: svgtinyps [options] [command] [input-file] [output-file]'.PHP_EOL;
echo PHP_EOL;
echo 'Options:'.PHP_EOL;
echo " -v, --verbose Enable verbose mode".PHP_EOL;
echo ' -v, --verbose Enable verbose mode'.PHP_EOL;
echo PHP_EOL;
echo 'Commands:'.PHP_EOL;
echo ' convert [input] [output] - Convert SVG file'.PHP_EOL;
Expand All @@ -57,7 +57,7 @@ function showHelp()
echo ' help - Show this help information'.PHP_EOL;
echo PHP_EOL;
echo 'Informations:'.PHP_EOL;
echo !str_starts_with($version, '@git_tag') ? ' Version: '.$version.PHP_EOL : '';
echo ! str_starts_with($version, '@git_tag') ? ' Version: '.$version.PHP_EOL : '';
// echo 'PHP sapi name: '.php_sapi_name().PHP_EOL;
echo ' Based on https://github.com/srwiez/php-svg-ps-converter version: '.getComposerVersion('srwiez/php-svg-ps-converter').PHP_EOL;
echo ' Built with https://github.com/box-project/box'.PHP_EOL;
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
test('it output an error if output directory does not exist', function () {
exec('php src/svgtinyps.php convert assets/twitter.svg tmp/output/does-not-exist.svg', $output, $exitCode);
$output = implode("\n", $output); // Combine array elements into a single string
expect($output)->toContain("Error: The output directory either does not exist or is not writeable")
expect($output)->toContain('Error: The output directory either does not exist or is not writeable')
->and($exitCode)->toBe(1);
});

test('it output an error if output directory is not provided', function () {
exec('php src/svgtinyps.php convert assets/twitter.svg', $output, $exitCode);
$output = implode("\n", $output); // Combine array elements into a single string
expect($output)->toContain("Error: Output file not provided for conversion")
expect($output)->toContain('Error: Output file not provided for conversion')
->and($exitCode)->toBe(1);
});

0 comments on commit 52b5d0d

Please sign in to comment.