@@ -42,30 +42,30 @@ public function testInternalRefDoesNotGetExpanded()
42
42
43
43
44
44
/**
45
- * While definitely not recommended, including a standard named "Internal", _does_ allow for sniffs to be registered .
45
+ * As of PHPCS 4.0, a standard can no longer be named "Internal" .
46
46
*
47
- * Note: customizations (exclusions/property setting etc) for individual sniffs may not always be handled correctly,
48
- * which is why naming a standard "Internal" is definitely not recommended.
47
+ * Standards with this name will be ignored.
49
48
*
50
49
* @return void
51
50
*/
52
- public function testInternalStandardDoesGetExpanded ()
51
+ public function testInternalStandardIsNotSupported ()
53
52
{
54
- $ message = 'DEPRECATED : The name "Internal" is reserved for internal use. A PHP_CodeSniffer standard should not be called "Internal". ' .PHP_EOL ;
53
+ $ message = 'ERROR : The name "Internal" is reserved for internal use. A PHP_CodeSniffer standard should not be called "Internal". ' .PHP_EOL ;
55
54
$ message .= 'Contact the maintainer of the standard to fix this. ' .PHP_EOL .PHP_EOL ;
56
55
57
- $ this ->expectOutputString ($ message );
56
+ $ this ->expectRuntimeExceptionMessage ($ message );
58
57
59
58
// Set up the ruleset.
60
59
$ standard = __DIR__ .'/ExpandRulesetReferenceInternalStandardTest.xml ' ;
61
60
$ config = new ConfigDouble (["--standard= $ standard " ]);
62
61
$ ruleset = new Ruleset ($ config );
63
62
64
- $ expected = ['Internal.Valid.Valid ' => 'Fixtures \\ Internal \\ Sniffs \\Valid \\ ValidSniff ' ];
63
+ $ expected = ['Generic.PHP.BacktickOperator ' => 'PHP_CodeSniffer \\ Standards \\ Generic \\ Sniffs \\PHP \\ BacktickOperatorSniff ' ];
65
64
65
+ // This assertion will only take effect for PHPUnit 10+.
66
66
$ this ->assertSame ($ expected , $ ruleset ->sniffCodes );
67
67
68
- }//end testInternalStandardDoesGetExpanded ()
68
+ }//end testInternalStandardIsNotSupported ()
69
69
70
70
71
71
}//end class
0 commit comments