diff --git a/composer.json b/composer.json index a35c361..5a13e61 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^0.12", "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^9.5.25", + "phpunit/phpunit": "^9.5.26", "slam/phpstan-laminas-framework": "^0.12", "squizlabs/php_codesniffer": "^3.7" }, diff --git a/tests/TestSuite/CliTest.php b/tests/TestSuite/CliTest.php index 8bae3c9..a9a33cc 100644 --- a/tests/TestSuite/CliTest.php +++ b/tests/TestSuite/CliTest.php @@ -93,4 +93,17 @@ public function testRunWithOptionsMustBeUsedByTheLinter() '.test { display: block; }' ])); } + + public function testRunWithInvalidOptionsFormatShouldReturnAnError() + { + $this->expectOutputString( + "\033[31m/!\ Error: Unable to parse option argument: Syntax error\033[0m" . PHP_EOL . + PHP_EOL + ); + $this->assertEquals(1, $this->cli->run([ + 'php-css-lint', + '--options={ "allowedIndentationChars": }', + '.test { display: block; }' + ])); + } }