Skip to content

Commit

Permalink
Performance/NoPaging: add extra tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Aug 25, 2023
1 parent 0fd1c85 commit 6890027
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 4 additions & 2 deletions WordPressVIPMinimum/Tests/Performance/NoPagingUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ class NoPagingUnitTest extends AbstractSniffUnitTest {
*/
public function getErrorList() {
return [
4 => 1,
7 => 1,
4 => 1,
7 => 1,
13 => 1,
15 => 1,
];
}

Expand Down

0 comments on commit 6890027

Please sign in to comment.