Skip to content

Commit

Permalink
Merge pull request #1829 from WordPress/feature/update-minimum-wp-ver…
Browse files Browse the repository at this point in the history
…sion-property

Update default minimum supported WP version
  • Loading branch information
dingo-d committed Nov 2, 2019
2 parents ae449aa + c65d63b commit 7a626f3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion WordPress/Sniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract class Sniff implements PHPCS_Sniff {
*
* @var string WordPress version.
*/
public $minimum_supported_version = '4.9';
public $minimum_supported_version = '5.0';

/**
* Custom list of classes which test classes can extend.
Expand Down
6 changes: 4 additions & 2 deletions WordPress/Tests/WP/DeprecatedClassesUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ echo \WP_User_Search::prepare_query();
class My_User_Search extends WP_User_Search {}
class Our_User_Search implements WP_User_Search {}
$a = (new WP_User_Search())->query();
/* ============ WP 4.9 ============ */
class Prefix_Menu_section extends Customize_New_Menu_Section {}
WP_Customize_New_Menu_Control::foo();

/*
* Warning.
*/
class Prefix_Menu_section extends Customize_New_Menu_Section {}
WP_Customize_New_Menu_Control::foo();
/* ============ WP 5.3 ============ */
$json = new Services_JSON;
9 changes: 7 additions & 2 deletions WordPress/Tests/WP/DeprecatedClassesUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class DeprecatedClassesUnitTest extends AbstractSniffUnitTest {
* @return array <int line number> => <int number of errors>
*/
public function getErrorList() {
return array_fill( 9, 7, 1 );
$errors = array_fill( 9, 10, 1 );

// Unset the lines related to version comments.
unset( $errors[16] );

return $errors;
}

/**
Expand All @@ -36,7 +41,7 @@ public function getErrorList() {
* @return array <int line number> => <int number of warnings>
*/
public function getWarningList() {
return array_fill( 20, 3, 1 );
return array_fill( 24, 1, 1 );
}

}
8 changes: 4 additions & 4 deletions WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ wp_get_network();
wp_kses_js_entities();
/* ============ WP 4.8 ============ */
wp_dashboard_plugins_output();

/*
* Warning.
*/
/* ============ WP 4.9 ============ */
get_shortcut_link();
is_user_option_local();
wp_ajax_press_this_add_category();
wp_ajax_press_this_save_post();

/*
* Warning.
*/
/* ============ WP 5.1 ============ */
insert_blog();
install_blog();
Expand Down
9 changes: 5 additions & 4 deletions WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest {
*/
public function getErrorList() {

$errors = array_fill( 8, 324, 1 );
$errors = array_fill( 8, 329, 1 );

// Unset the lines related to version comments.
unset(
Expand Down Expand Up @@ -62,7 +62,8 @@ public function getErrorList() {
$errors[311],
$errors[319],
$errors[323],
$errors[330]
$errors[330],
$errors[332]
);

return $errors;
Expand All @@ -75,10 +76,10 @@ public function getErrorList() {
*/
public function getWarningList() {

$warnings = array_fill( 337, 11, 1 );
$warnings = array_fill( 342, 6, 1 );

// Unset the lines related to version comments.
unset( $warnings[341], $warnings[344] );
unset( $warnings[344] );

return $warnings;
}
Expand Down

0 comments on commit 7a626f3

Please sign in to comment.