Skip to content

Commit 6d8f58a

Browse files
committed
NamingConventions/PrefixAllGlobals: address PR feedback
1 parent 0f2d04b commit 6d8f58a

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.3.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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 );

WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff 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':

0 commit comments

Comments
 (0)