Skip to content

Commit 933db1a

Browse files
committed
SniffsExcludeArgsTest: allow for the test to pass in CBF mode
1 parent fff82e5 commit 933db1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/Core/Config/SniffsExcludeArgsTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ final class SniffsExcludeArgsTest extends TestCase
3434
*/
3535
public function testInvalid($argument, $value, $errors, $suggestion)
3636
{
37+
$cmd = 'phpcs';
38+
if (PHP_CODESNIFFER_CBF === true) {
39+
$cmd = 'phpcbf';
40+
}
41+
3742
$exception = 'PHP_CodeSniffer\Exceptions\DeepExitException';
3843
$message = 'ERROR: The --'.$argument.' option only supports sniff codes.'.PHP_EOL;
3944
$message .= 'Sniff codes are in the form "Standard.Category.Sniff".'.PHP_EOL;
@@ -47,7 +52,7 @@ public function testInvalid($argument, $value, $errors, $suggestion)
4752
}
4853

4954
$message .= PHP_EOL;
50-
$message .= 'Run "phpcs --help" for usage information'.PHP_EOL;
55+
$message .= "Run \"{$cmd} --help\" for usage information".PHP_EOL;
5156
$message .= PHP_EOL;
5257

5358
if (method_exists($this, 'expectException') === true) {

0 commit comments

Comments
 (0)