File tree Expand file tree Collapse file tree
WordPress/Tests/NamingConventions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ $acronym_test = new class extends \phpunit_framework_testcase {
2121 }
2222};
2323
24- class Some_Test extends WP_Font_Face_UnitTestCase {
24+ // Test namespace resolution when the sniff checks the extending class.
25+ class Extends_Namespaced_Class_Not_WP_Test extends WP_Font_Face_UnitTestCase {
2526
2627 public function testPass () {
2728 do_action ( 'some-action ' , $ something );
@@ -31,21 +32,21 @@ class Some_Test extends WP_Font_Face_UnitTestCase {
3132/*
3233 * Safeguard correct handling of namespaced extending classes.
3334 */
34- class Some_Test extends MyNamespace \WP_UnitTestCase_Base {
35+ class Extends_Partially_Qualified_Not_WP_Test extends MyNamespace \WP_UnitTestCase_Base {
3536
3637 public function testPass () {
3738 do_action ( 'some-action ' , $ something );
3839 }
3940}
4041
41- class Some_Test extends \MyNamespace \WP_Ajax_UnitTestCase {
42+ class Extends_Fully_Qualified_Not_WP_Test extends \MyNamespace \WP_Ajax_UnitTestCase {
4243
4344 public function testPass () {
4445 do_action ( 'some-action ' , $ something );
4546 }
4647}
4748
48- class Some_Test extends namespace \WP_Canonical_UnitTestCase {
49+ class Extends_Relative_Namespace_Not_WP_Test extends namespace \WP_Canonical_UnitTestCase {
4950
5051 public function testPass () {
5152 do_action ( 'some-action ' , $ something );
Original file line number Diff line number Diff line change @@ -100,19 +100,18 @@ public function getErrorList( $testFile = 'PrefixAllGlobalsUnitTest.1.inc' ) {
100100 693 => 1 ,
101101 );
102102
103- case 'PrefixAllGlobalsUnitTest.4 .inc ' :
103+ case 'PrefixAllGlobalsUnitTest.3 .inc ' :
104104 return array (
105- 1 => 1 , // 1 x error for blocked prefix passed.
106- 18 => 1 ,
105+ 28 => 1 ,
106+ 38 => 1 ,
107+ 45 => 1 ,
108+ 52 => 1 ,
107109 );
108110
109- case 'PrefixAllGlobalsUnitTest.3.inc ' :
110- // Test class - non-prefixed constant is fine.
111+ case 'PrefixAllGlobalsUnitTest.4.inc ' :
111112 return array (
112- 27 => 1 ,
113- 37 => 1 ,
114- 44 => 1 ,
115- 51 => 1 ,
113+ 1 => 1 , // 1 x error for blocked prefix passed.
114+ 18 => 1 ,
116115 );
117116
118117 case 'PrefixAllGlobalsUnitTest.2.inc ' :
You can’t perform that action at this time.
0 commit comments