Skip to content

Commit 4e384e2

Browse files
committed
Update the minimum_wp_version to WP 6.2
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
1 parent 16d40a0 commit 4e384e2

7 files changed

+20
-24
lines changed

WordPress/Helpers/MinimumWPVersionTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trait MinimumWPVersionTrait {
7979
*
8080
* @var string WordPress version.
8181
*/
82-
private $default_minimum_wp_version = '6.0';
82+
private $default_minimum_wp_version = '6.2';
8383

8484
/**
8585
* Overrule the minimum supported WordPress version with a command-line/config value.

WordPress/Tests/DB/PreparedSQLPlaceholdersUnitTest.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ $where = $wpdb->prepare(
343343
); // OK.
344344

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

351351
$where = $wpdb->prepare(
352352
"{$wpdb->posts}.post_type IN ("

WordPress/Tests/DB/PreparedSQLPlaceholdersUnitTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function getErrorList() {
101101
315 => 1,
102102
322 => 1,
103103

104-
347 => 2, // UnsupportedIdentifierPlaceholder + IdentifierWithinIN.
104+
348 => 2, // UnsupportedIdentifierPlaceholder + IdentifierWithinIN.
105105
353 => 1,
106106

107107
// Named parameter support.

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ _excerpt_render_inner_columns_blocks();
360360
readonly();
361361
/* ============ WP 5.9.1 ============ */
362362
wp_render_duotone_filter_preset();
363-
364-
/*
365-
* Warning.
366-
*/
367363
/* ============ WP 6.0 ============ */
368364
image_attachment_fields_to_save();
369365
wp_add_iframed_editor_assets_html();
@@ -384,6 +380,10 @@ install_global_terms();
384380
sync_category_tag_slugs();
385381
wp_get_attachment_thumb_file();
386382
wp_typography_get_css_variable_inline_style();
383+
384+
/*
385+
* Warning.
386+
*/
387387
/* ============ WP 6.2 ============ */
388388
_resolve_home_block_template();
389389
get_page_by_title();

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest {
2828
*/
2929
public function getErrorList() {
3030
$start_line = 8;
31-
$end_line = 362;
31+
$end_line = 382;
3232
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
3333

3434
// Unset the lines related to version comments.
@@ -73,7 +73,11 @@ public function getErrorList() {
7373
$errors[353],
7474
$errors[357],
7575
$errors[359],
76-
$errors[361]
76+
$errors[361],
77+
$errors[363],
78+
$errors[369],
79+
$errors[371],
80+
$errors[373]
7781
);
7882

7983
return $errors;
@@ -85,16 +89,12 @@ public function getErrorList() {
8589
* @return array<int, int> Key is the line number, value is the number of expected warnings.
8690
*/
8791
public function getWarningList() {
88-
$start_line = 368;
92+
$start_line = 388;
8993
$end_line = 428;
9094
$warnings = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
9195

9296
// Unset the lines related to version comments.
9397
unset(
94-
$warnings[373],
95-
$warnings[375],
96-
$warnings[377],
97-
$warnings[387],
9898
$warnings[390],
9999
$warnings[414],
100100
$warnings[425]

WordPress/Tests/WP/DeprecatedParametersUnitTest.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ wp_notify_postauthor( '', 'null' ); // Null as a string not null.
9494
wp_title_rss( 'deprecated' );
9595
wp_upload_bits( '', 'deprecated' );
9696
xfn_check( '', '', 'deprecated' );
97+
global_terms( $foo, 'deprecated' );
9798

9899
// All will give an WARNING as they have been deprecated after WP 5.8.
99-
global_terms( $foo, 'deprecated' );

WordPress/Tests/WP/DeprecatedParametersUnitTest.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class DeprecatedParametersUnitTest extends AbstractSniffUnitTest {
2828
*/
2929
public function getErrorList() {
3030
$start_line = 42;
31-
$end_line = 96;
31+
$end_line = 97;
3232
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
3333

3434
$errors[22] = 1;
@@ -51,10 +51,6 @@ public function getErrorList() {
5151
* @return array<int, int> Key is the line number, value is the number of expected warnings.
5252
*/
5353
public function getWarningList() {
54-
$start_line = 99;
55-
$end_line = 99;
56-
$errors = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
57-
58-
return $errors;
54+
return array();
5955
}
6056
}

0 commit comments

Comments
 (0)