Make WordPress Core


Ignore:
Timestamp:
01/13/2016 04:36:54 AM (11 years ago)
Author:
boonebgorges
Message:

Support searching for '0' in WP_Query.

Props swissspidy.
See #31025.

File:
1 edited

Legend:

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

    r36251 r36278  
    138138                $this->assertNotRegExp( '|ORDER BY \(CASE[^\)]+\)|', $q->request );
    139139        }
     140
     141        /**
     142         * @ticket 31025
     143         */
     144        public function test_s_zero() {
     145                $p1 = $this->factory->post->create( array(
     146                        'post_status' => 'publish',
     147                        'post_title' => '1',
     148                ) );
     149
     150                $p2 = $this->factory->post->create( array(
     151                        'post_status' => 'publish',
     152                        'post_title' => '0',
     153                ) );
     154
     155                $q = new WP_Query( array(
     156                        's' => '0',
     157                        'fields' => 'ids',
     158                ) );
     159
     160                $this->assertEqualSets( array( $p2 ), $q->posts );
     161        }
    140162}
Note: See TracChangeset for help on using the changeset viewer.