@@ -42,30 +42,30 @@ public function testInternalRefDoesNotGetExpanded()
4242
4343
4444 /**
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" .
4646 *
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.
4948 *
5049 * @return void
5150 */
52- public function testInternalStandardDoesGetExpanded ()
51+ public function testInternalStandardIsNotSupported ()
5352 {
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 ;
5554 $ message .= 'Contact the maintainer of the standard to fix this. ' .PHP_EOL .PHP_EOL ;
5655
57- $ this ->expectOutputString ($ message );
56+ $ this ->expectRuntimeExceptionMessage ($ message );
5857
5958 // Set up the ruleset.
6059 $ standard = __DIR__ .'/ExpandRulesetReferenceInternalStandardTest.xml ' ;
6160 $ config = new ConfigDouble (["--standard= $ standard " ]);
6261 $ ruleset = new Ruleset ($ config );
6362
64- $ expected = ['Internal.Valid.Valid ' => 'Fixtures \\ Internal \\ Sniffs \\Valid \\ ValidSniff ' ];
63+ $ expected = ['Generic.PHP.BacktickOperator ' => 'PHP_CodeSniffer \\ Standards \\ Generic \\ Sniffs \\PHP \\ BacktickOperatorSniff ' ];
6564
65+ // This assertion will only take effect for PHPUnit 10+.
6666 $ this ->assertSame ($ expected , $ ruleset ->sniffCodes );
6767
68- }//end testInternalStandardDoesGetExpanded ()
68+ }//end testInternalStandardIsNotSupported ()
6969
7070
7171}//end class
0 commit comments