diff --git a/WordPress/Tests/Classes/ClassInstantiationUnitTest.2.inc b/WordPress/Tests/Classes/ClassInstantiationUnitTest.2.inc deleted file mode 100644 index 7b3038a5b6..0000000000 --- a/WordPress/Tests/Classes/ClassInstantiationUnitTest.2.inc +++ /dev/null @@ -1,17 +0,0 @@ - 1, 38 => 1, @@ -70,12 +53,8 @@ public function getErrorList( $testFile = '' ) { 80 => 1, 84 => 1, 85 => 1, - ); - - case 'ClassInstantiationUnitTest.2.inc': - return array( - 16 => 1, - 17 => 1, + 97 => 1, + 98 => 1, ); case 'ClassInstantiationUnitTest.js': diff --git a/WordPress/Tests/DB/RestrictedClassesUnitTest.php b/WordPress/Tests/DB/RestrictedClassesUnitTest.php index 75e2234125..4bf68b6c75 100644 --- a/WordPress/Tests/DB/RestrictedClassesUnitTest.php +++ b/WordPress/Tests/DB/RestrictedClassesUnitTest.php @@ -52,15 +52,6 @@ protected function tearDown() { parent::tearDown(); } - /** - * Skip this test on PHP 5.2 as otherwise testing the namespace resolving would fail. - * - * @return bool Whether to skip this test. - */ - protected function shouldSkipTest() { - return ( PHP_VERSION_ID < 50300 ); - } - /** * Returns the lines where errors should occur. * diff --git a/WordPress/Tests/Files/FileNameUnitTest.php b/WordPress/Tests/Files/FileNameUnitTest.php index edd38737cb..85a1f87aa2 100644 --- a/WordPress/Tests/Files/FileNameUnitTest.php +++ b/WordPress/Tests/Files/FileNameUnitTest.php @@ -97,11 +97,6 @@ protected function getTestFiles( $testFileBase ) { $sep = DIRECTORY_SEPARATOR; $test_files = glob( dirname( $testFileBase ) . $sep . 'FileNameUnitTests{' . $sep . ',' . $sep . '*' . $sep . '}*.inc', GLOB_BRACE ); - // Adjust the expected results array for PHP 5.2 as PHP 5.2 does not recognize namespaces. - if ( PHP_VERSION_ID < 50300 ) { - $this->expected_results['test-sample-phpunit6.inc'] = 1; - } - if ( ! empty( $test_files ) ) { return $test_files; } diff --git a/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.php b/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.php index 352f333ab4..108471574b 100644 --- a/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.php +++ b/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.php @@ -52,12 +52,6 @@ public function getErrorList( $testFile = 'PrefixAllGlobalsUnitTest.inc' ) { 40 => 1, 90 => 1, 91 => 1, - // Scoped. - 149 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, // PHPCS on PHP 5.2 does not recognize namespaces. - 151 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, // PHPCS on PHP 5.2 does not recognize namespaces. - 153 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, // PHPCS on PHP 5.2 does not recognize namespaces. - 154 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, // PHPCS on PHP 5.2 does not recognize namespaces. - 155 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, // PHPCS on PHP 5.2 does not recognize namespaces. // Backfills. 225 => ( function_exists( '\mb_strpos' ) ) ? 0 : 1, 230 => ( function_exists( '\array_column' ) ) ? 0 : 1, @@ -66,20 +60,7 @@ public function getErrorList( $testFile = 'PrefixAllGlobalsUnitTest.inc' ) { ); case 'PrefixAllGlobalsUnitTest.1.inc': - // Namespaced - all OK. - if ( PHP_VERSION_ID >= 50300 ) { - return array(); - } - - // PHPCS on PHP 5.2 does not recognize namespaces. - return array( - 9 => 1, - 11 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - ); - + // Namespaced - all OK, fall through to the default case. default: return array(); diff --git a/WordPress/Tests/VIP/AdminBarRemovalUnitTest.php b/WordPress/Tests/VIP/AdminBarRemovalUnitTest.php index 3e07aa6333..7adbae60df 100644 --- a/WordPress/Tests/VIP/AdminBarRemovalUnitTest.php +++ b/WordPress/Tests/VIP/AdminBarRemovalUnitTest.php @@ -43,9 +43,9 @@ public function getErrorList( $testFile = '' ) { 21 => 1, 26 => 1, 32 => 1, - 56 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. - 57 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. - 58 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. + 56 => 1, + 57 => 1, + 58 => 1, 68 => 1, 69 => 1, 70 => 1, @@ -60,7 +60,7 @@ public function getErrorList( $testFile = '' ) { case 'AdminBarRemovalUnitTest.css': return array( - 15 => 1, + 15 => 1, 16 => 1, 17 => 1, 22 => 1, diff --git a/WordPress/Tests/VIP/DirectDatabaseQueryUnitTest.php b/WordPress/Tests/VIP/DirectDatabaseQueryUnitTest.php index 0a45e1177e..41a8d786d2 100644 --- a/WordPress/Tests/VIP/DirectDatabaseQueryUnitTest.php +++ b/WordPress/Tests/VIP/DirectDatabaseQueryUnitTest.php @@ -41,7 +41,7 @@ public function getErrorList() { 190 => 1, 250 => 1, 257 => 1, - 274 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. + 274 => 1, ); } diff --git a/WordPress/Tests/VIP/PluginMenuSlugUnitTest.php b/WordPress/Tests/VIP/PluginMenuSlugUnitTest.php index e8b142712f..5a8307c2ce 100644 --- a/WordPress/Tests/VIP/PluginMenuSlugUnitTest.php +++ b/WordPress/Tests/VIP/PluginMenuSlugUnitTest.php @@ -28,10 +28,9 @@ class PluginMenuSlugUnitTest extends AbstractSniffUnitTest { */ public function getErrorList() { return array( - 3 => 1, - 5 => 1, - 9 => 2, - 14 => ( PHP_VERSION_ID < 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NS_SEPARATOR. + 3 => 1, + 5 => 1, + 9 => 2, ); } diff --git a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php index 33d09b3f71..341e85e9e0 100644 --- a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php +++ b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php @@ -30,7 +30,6 @@ public function getErrorList() { return array( 3 => 1, 17 => 1, - 30 => ( PHP_VERSION_ID >= 50300 ) ? 0 : 1, 32 => 1, 34 => 1, 36 => 1, diff --git a/WordPress/Tests/WP/CapitalPDangitUnitTest.1.inc b/WordPress/Tests/WP/CapitalPDangitUnitTest.1.inc deleted file mode 100644 index 62e82673db..0000000000 --- a/WordPress/Tests/WP/CapitalPDangitUnitTest.1.inc +++ /dev/null @@ -1,10 +0,0 @@ - wordpress.pot + + wordpress.pot + + => */ - public function getWarningList( $testFile = 'CapitalPDangitUnitTest.inc' ) { + public function getWarningList() { - switch ( $testFile ) { - case 'CapitalPDangitUnitTest.inc': - return array( - 3 => 1, - 5 => 1, - 8 => 1, - 26 => 1, - 28 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 40 => 1, - 41 => 1, - 45 => 1, - 53 => 1, - 60 => 1, - 61 => 1, - 62 => 1, - 65 => 1, - 66 => 1, - 68 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 2, // PHPCS on PHP 5.2 apparently breaks the token up into two tokens. - 101 => 1, - 139 => 1, - 146 => 0, // False negative. - 173 => 1, - ); + return array( + 3 => 1, + 5 => 1, + 8 => 1, + 26 => 1, + 28 => 1, + 34 => 1, + 35 => 1, + 36 => 1, + 40 => 1, + 41 => 1, + 45 => 1, + 53 => 1, + 60 => 1, + 61 => 1, + 62 => 1, + 65 => 1, + 66 => 1, + 68 => 1, + 101 => 1, + 139 => 1, + 146 => 0, // False negative. + 173 => 1, + 181 => 1, + ); - case 'CapitalPDangitUnitTest.1.inc': - return array( - 9 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize nowdocs. - ); - - default: - return array(); - - } // End switch(). } } // End class. diff --git a/WordPress/Tests/WP/EnqueuedResourcesUnitTest.php b/WordPress/Tests/WP/EnqueuedResourcesUnitTest.php index d36bb6aafd..dd19200ca5 100644 --- a/WordPress/Tests/WP/EnqueuedResourcesUnitTest.php +++ b/WordPress/Tests/WP/EnqueuedResourcesUnitTest.php @@ -29,9 +29,9 @@ class EnqueuedResourcesUnitTest extends AbstractSniffUnitTest { public function getErrorList() { return array( 1 => 1, - 2 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 has a bug tokenizing inline HTML / ` 1, 6 => 1, - 7 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 has a bug tokenizing inline HTML / ` 1, 10 => 1, 11 => 1, 13 => 1, @@ -40,10 +40,10 @@ public function getErrorList() { 17 => 1, 20 => 1, 21 => 1, - 25 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize double quoted T_HEREDOC. - 26 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize double quoted T_HEREDOC. - 30 => 1, // PHPCS on PHP 5.2 does not recognize T_NOWDOC, but sees this as a literal string anyway. - 31 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. + 25 => 1, + 26 => 1, + 30 => 1, + 31 => 1, ); } diff --git a/WordPress/Tests/WP/I18nUnitTest.php b/WordPress/Tests/WP/I18nUnitTest.php index 7a44bebd69..0083094b60 100644 --- a/WordPress/Tests/WP/I18nUnitTest.php +++ b/WordPress/Tests/WP/I18nUnitTest.php @@ -106,7 +106,7 @@ public function getErrorList( $testFile = 'I18nUnitTest.inc' ) { 125 => 1, 128 => 1, 129 => 1, - 132 => ( PHP_VERSION_ID >= 50300 ) ? 1 : 2, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. + 132 => 1, 138 => 1, 143 => 1, 148 => 1, diff --git a/WordPress/Tests/WP/PreparedSQLUnitTest.php b/WordPress/Tests/WP/PreparedSQLUnitTest.php index 2b06196616..bccc30f1bb 100644 --- a/WordPress/Tests/WP/PreparedSQLUnitTest.php +++ b/WordPress/Tests/WP/PreparedSQLUnitTest.php @@ -29,7 +29,7 @@ class PreparedSQLUnitTest extends AbstractSniffUnitTest { * @return array => */ public function getErrorList() { - $errors = array( + return array( 3 => 1, 4 => 1, 5 => 1, @@ -44,23 +44,6 @@ public function getErrorList() { 64 => 1, 71 => 1, ); - - // Deal with PHP 5.2 not recognizing quoted heredoc openers, nor nowdoc syntax. - // These are all false positives! - if ( PHP_VERSION_ID < 50300 ) { - $errors[68] = 2; - $errors[69] = 2; - $errors[70] = 2; - $errors[71] = 4; - $errors[75] = 2; - $errors[76] = 7; - $errors[77] = 4; - $errors[78] = 5; - $errors[79] = 7; - $errors[80] = 1; - } - - return $errors; } /** diff --git a/WordPress/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/WordPress/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php index 7c63a07c40..642f69c436 100644 --- a/WordPress/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ b/WordPress/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php @@ -21,17 +21,6 @@ */ class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest { - /** - * Skip this test on PHP 5.2. - * - * @since 0.9.0 - * - * @return bool Whether to skip this test. - */ - protected function shouldSkipTest() { - return ( PHP_VERSION_ID < 50300 ); - } - /** * Returns the lines where errors should occur. * diff --git a/WordPress/Tests/XSS/EscapeOutputUnitTest.php b/WordPress/Tests/XSS/EscapeOutputUnitTest.php index b5560247fe..0be554aab4 100644 --- a/WordPress/Tests/XSS/EscapeOutputUnitTest.php +++ b/WordPress/Tests/XSS/EscapeOutputUnitTest.php @@ -69,7 +69,6 @@ public function getErrorList() { 205 => 1, 206 => 1, 207 => 1, - 212 => ( PHP_VERSION_ID < 50300 ) ? 1 : 0, // PHPCS on PHP 5.2 does not recognize T_NOWDOC. 223 => 1, 225 => 1, 226 => 1,