diff --git a/WordPress/Sniffs/WP/CapitalPDangitSniff.php b/WordPress/Sniffs/WP/CapitalPDangitSniff.php index edbd3ebe97..bf98233fb9 100644 --- a/WordPress/Sniffs/WP/CapitalPDangitSniff.php +++ b/WordPress/Sniffs/WP/CapitalPDangitSniff.php @@ -28,7 +28,7 @@ class CapitalPDangitSniff extends Sniff { * Regex to match a large number or spelling variations of WordPress in text strings. * * Prevents matches on: - * - URLs for wordpress.org/com/net/tv. + * - URLs for wordpress.org/com/net/test/tv. * - `@...` usernames starting with `wordpress` * - email addresses with a domain starting with `wordpress` * - email addresses with a user name ending with `wordpress` @@ -42,7 +42,7 @@ class CapitalPDangitSniff extends Sniff { * * @var string */ - const WP_REGEX = '#(?\'"()]*?\.(?:php|js|css|png|j[e]?pg|gif|pot))#i'; + const WP_REGEX = '#(?\'"()]*?\.(?:php|js|css|png|j[e]?pg|gif|pot))#i'; /** * Regex to match a large number or spelling variations of WordPress in class names. diff --git a/WordPress/Tests/WP/CapitalPDangitUnitTest.inc b/WordPress/Tests/WP/CapitalPDangitUnitTest.inc index 33622aa88c..e29ee8942f 100644 --- a/WordPress/Tests/WP/CapitalPDangitUnitTest.inc +++ b/WordPress/Tests/WP/CapitalPDangitUnitTest.inc @@ -188,3 +188,6 @@ class TestMe { ANOTHER => array( 'a' => 'b' ), WORDPRESS_SOMETHING = 'wordpress'; // OK (complex declaration to make sure start of statement is detected correctly). } + +// Allow "test" domain. +$value = function_call( 'git.wordpress.test' ); diff --git a/WordPress/Tests/WP/CapitalPDangitUnitTest.inc.fixed b/WordPress/Tests/WP/CapitalPDangitUnitTest.inc.fixed index 7dc636aa88..0a00f5ec0d 100644 --- a/WordPress/Tests/WP/CapitalPDangitUnitTest.inc.fixed +++ b/WordPress/Tests/WP/CapitalPDangitUnitTest.inc.fixed @@ -188,3 +188,6 @@ class TestMe { ANOTHER => array( 'a' => 'b' ), WORDPRESS_SOMETHING = 'wordpress'; // OK (complex declaration to make sure start of statement is detected correctly). } + +// Allow "test" domain. +$value = function_call( 'git.wordpress.test' );