WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (3 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/noFoundRows.php

    r37600 r42343  
    66class Tests_Query_NoFoundRows extends WP_UnitTestCase {
    77    public function test_no_found_rows_default() {
    8         $q = new WP_Query( array(
    9             'post_type' => 'post',
    10         ) );
     8        $q = new WP_Query(
     9            array(
     10                'post_type' => 'post',
     11            )
     12        );
    1113
    1214        $this->assertContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    1416
    1517    public function test_no_found_rows_false() {
    16         $q = new WP_Query( array(
    17             'post_type' => 'post',
    18             'no_found_rows' => false,
    19         ) );
     18        $q = new WP_Query(
     19            array(
     20                'post_type'     => 'post',
     21                'no_found_rows' => false,
     22            )
     23        );
    2024
    2125        $this->assertContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    2327
    2428    public function test_no_found_rows_0() {
    25         $q = new WP_Query( array(
    26             'post_type' => 'post',
    27             'no_found_rows' => 0,
    28         ) );
     29        $q = new WP_Query(
     30            array(
     31                'post_type'     => 'post',
     32                'no_found_rows' => 0,
     33            )
     34        );
    2935
    3036        $this->assertContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    3238
    3339    public function test_no_found_rows_empty_string() {
    34         $q = new WP_Query( array(
    35             'post_type' => 'post',
    36             'no_found_rows' => '',
    37         ) );
     40        $q = new WP_Query(
     41            array(
     42                'post_type'     => 'post',
     43                'no_found_rows' => '',
     44            )
     45        );
    3846
    3947        $this->assertContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    4149
    4250    public function test_no_found_rows_true() {
    43         $q = new WP_Query( array(
    44             'post_type' => 'post',
    45             'no_found_rows' => true,
    46         ) );
     51        $q = new WP_Query(
     52            array(
     53                'post_type'     => 'post',
     54                'no_found_rows' => true,
     55            )
     56        );
    4757
    4858        $this->assertNotContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    5060
    5161    public function test_no_found_rows_non_bool_cast_to_true() {
    52         $q = new WP_Query( array(
    53             'post_type' => 'post',
    54             'no_found_rows' => 'foo',
    55         ) );
     62        $q = new WP_Query(
     63            array(
     64                'post_type'     => 'post',
     65                'no_found_rows' => 'foo',
     66            )
     67        );
    5668
    5769        $this->assertNotContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    6476        $p = $this->factory->post->create();
    6577
    66         $q = new WP_Query( array(
    67             'post_type' => 'post',
    68             'nopaging' => true,
    69         ) );
     78        $q = new WP_Query(
     79            array(
     80                'post_type' => 'post',
     81                'nopaging'  => true,
     82            )
     83        );
    7084
    7185        $this->assertNotContains( 'SQL_CALC_FOUND_ROWS', $q->request );
     
    7993        $p = $this->factory->post->create();
    8094
    81         $q = new WP_Query( array(
    82             'post_type' => 'post',
    83             'posts_per_page' => -1,
    84         ) );
     95        $q = new WP_Query(
     96            array(
     97                'post_type'      => 'post',
     98                'posts_per_page' => -1,
     99            )
     100        );
    85101
    86102        $this->assertNotContains( 'SQL_CALC_FOUND_ROWS', $q->request );
Note: See TracChangeset for help on using the changeset viewer.