From 6890027a67288fee827b29e5dac3f1e0bcd96a87 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 7 Mar 2023 17:21:53 +0100 Subject: [PATCH] Performance/NoPaging: add extra tests Safeguard the fix which was added to WPCS 3.0.0 in response to WPCS issue WordPress/WordPress-Coding-Standards 2211, which was created to handle VIPCS issue 713. --- WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc | 6 ++++++ WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc b/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc index 87ec19c2..9af35243 100644 --- a/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc +++ b/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc @@ -7,3 +7,9 @@ $args = array( _query_posts( 'nopaging=true' ); // Bad. $query_args['my_posts_per_page'] = -1; // OK. + +// Verify handling with no trailing comma at end of array. +$args = array( + 'nopaging' => true // Bad. +); +$args = [ 'nopaging' => true ]; // Bad. diff --git a/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php b/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php index 66885a22..6b358c4d 100644 --- a/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php +++ b/WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php @@ -27,8 +27,10 @@ class NoPagingUnitTest extends AbstractSniffUnitTest { */ public function getErrorList() { return [ - 4 => 1, - 7 => 1, + 4 => 1, + 7 => 1, + 13 => 1, + 15 => 1, ]; }