Skip to content

Commit

Permalink
Update the minimum_wp_version to WP 6.2
Browse files Browse the repository at this point in the history
The minimum version should be three versions behind the latest WP release, so what with 6.5 being in RC, to be released on next week, it should now become 6.2.

Includes updating the tests to match.

Previous: 2121, 2321
  • Loading branch information
jrfnl committed Mar 21, 2024
1 parent 1c55b71 commit 5de64a0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion WordPress/Helpers/MinimumWPVersionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ trait MinimumWPVersionTrait {
*
* @var string WordPress version.
*/
private $default_minimum_wp_version = '6.0';
private $default_minimum_wp_version = '6.2';

/**
* Overrule the minimum supported WordPress version with a command-line/config value.
Expand Down
8 changes: 4 additions & 4 deletions WordPress/Tests/DB/PreparedSQLPlaceholdersUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ $where = $wpdb->prepare(
); // OK.

// Disregard comments in the array_fill() $value param.
$wpdb->prepare( '
xxx IN ( ' . implode( ',', array_fill( 0, count( $post_types ), '%i' /*comment*/ ) ) . ' )',
$fields
); // IdentifierWithinIN.
// Also test handling of %i when minimum supported WP version is not high enough yet.
// phpcs:set WordPress.DB.PreparedSQLPlaceholders minimum_wp_version 6.0
$wpdb->prepare( 'xxx IN ( ' . implode( ',', array_fill( 0, count( $post_types ), '%i' /*comment*/ ) ) . ' )', $fields ); // IdentifierWithinIN.
// phpcs:set WordPress.DB.PreparedSQLPlaceholders minimum_wp_version

$where = $wpdb->prepare(
"{$wpdb->posts}.post_type IN ("
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Tests/DB/PreparedSQLPlaceholdersUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getErrorList() {
315 => 1,
322 => 1,

347 => 2, // UnsupportedIdentifierPlaceholder + IdentifierWithinIN.
348 => 2, // UnsupportedIdentifierPlaceholder + IdentifierWithinIN.
353 => 1,

// Named parameter support.
Expand Down
8 changes: 4 additions & 4 deletions WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,6 @@ _excerpt_render_inner_columns_blocks();
readonly();
/* ============ WP 5.9.1 ============ */
wp_render_duotone_filter_preset();

/*
* Warning.
*/
/* ============ WP 6.0 ============ */
image_attachment_fields_to_save();
wp_add_iframed_editor_assets_html();
Expand All @@ -384,6 +380,10 @@ install_global_terms();
sync_category_tag_slugs();
wp_get_attachment_thumb_file();
wp_typography_get_css_variable_inline_style();

/*
* Warning.
*/
/* ============ WP 6.2 ============ */
_resolve_home_block_template();
get_page_by_title();
Expand Down
14 changes: 7 additions & 7 deletions WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest {
*/
public function getErrorList() {
$start_line = 8;
$end_line = 362;
$end_line = 382;
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );

// Unset the lines related to version comments.
Expand Down Expand Up @@ -73,7 +73,11 @@ public function getErrorList() {
$errors[353],
$errors[357],
$errors[359],
$errors[361]
$errors[361],
$errors[363],
$errors[369],
$errors[371],
$errors[373]
);

return $errors;
Expand All @@ -85,16 +89,12 @@ public function getErrorList() {
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList() {
$start_line = 368;
$start_line = 388;
$end_line = 428;
$warnings = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );

// Unset the lines related to version comments.
unset(
$warnings[373],
$warnings[375],
$warnings[377],
$warnings[387],
$warnings[390],
$warnings[414],
$warnings[425]
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Tests/WP/DeprecatedParametersUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ wp_notify_postauthor( '', 'null' ); // Null as a string not null.
wp_title_rss( 'deprecated' );
wp_upload_bits( '', 'deprecated' );
xfn_check( '', '', 'deprecated' );
global_terms( $foo, 'deprecated' );

// All will give an WARNING as they have been deprecated after WP 5.8.
global_terms( $foo, 'deprecated' );
8 changes: 2 additions & 6 deletions WordPress/Tests/WP/DeprecatedParametersUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DeprecatedParametersUnitTest extends AbstractSniffUnitTest {
*/
public function getErrorList() {
$start_line = 42;
$end_line = 96;
$end_line = 97;
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );

$errors[22] = 1;
Expand All @@ -51,10 +51,6 @@ public function getErrorList() {
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList() {
$start_line = 99;
$end_line = 99;
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );

return $errors;
return array();
}
}

0 comments on commit 5de64a0

Please sign in to comment.