mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-08 19:20:03 +00:00
Revert [28613] and [28664]. A good idea, but too much BC baggage.
See #28099. git-svn-id: https://develop.svn.wordpress.org/trunk@28783 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -402,13 +402,16 @@ class Tests_Query_Results extends WP_UnitTestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28099
|
||||
*/
|
||||
function test_empty_post__in() {
|
||||
$posts1 = $this->q->query( array() );
|
||||
$this->assertNotEmpty( $posts1 );
|
||||
$posts2 = $this->q->query( array( 'post__in' => array() ) );
|
||||
$this->assertEmpty( $posts2 );
|
||||
$this->assertNotEmpty( $posts2 );
|
||||
$posts3 = $this->q->query( array( 'post_parent__in' => array() ) );
|
||||
$this->assertEmpty( $posts3 );
|
||||
$this->assertNotEmpty( $posts3 );
|
||||
}
|
||||
|
||||
function test_exlude_from_search_empty() {
|
||||
@@ -514,7 +517,7 @@ class Tests_Query_Results extends WP_UnitTestCase {
|
||||
$this->assertEqualSets( array( $author_1, $author_2 ), $author_ids );
|
||||
|
||||
$posts = $this->q->query( array( 'author__in' => array() ) );
|
||||
$this->assertEmpty( $posts );
|
||||
$this->assertNotEmpty( $posts );
|
||||
|
||||
$posts = $this->q->query( array(
|
||||
'author__not_in' => array( $author_1, $author_2 ),
|
||||
|
||||
@@ -203,6 +203,9 @@ class Tests_Tax_Query extends WP_UnitTestCase {
|
||||
$this->assertEquals( array( $posts[0], $posts[3] ), $results2, 'Relation: AND; Operator: IN' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28099
|
||||
*/
|
||||
function test_empty__in() {
|
||||
$cat_id = $this->factory->category->create();
|
||||
$post_id = $this->factory->post->create();
|
||||
@@ -211,7 +214,7 @@ class Tests_Tax_Query extends WP_UnitTestCase {
|
||||
$q1 = get_posts( array( 'category__in' => array( $cat_id ) ) );
|
||||
$this->assertNotEmpty( $q1 );
|
||||
$q2 = get_posts( array( 'category__in' => array() ) );
|
||||
$this->assertEmpty( $q2 );
|
||||
$this->assertNotEmpty( $q2 );
|
||||
|
||||
$tag = wp_insert_term( 'woo', 'post_tag' );
|
||||
$tag_id = $tag['term_id'];
|
||||
@@ -221,11 +224,11 @@ class Tests_Tax_Query extends WP_UnitTestCase {
|
||||
$q3 = get_posts( array( 'tag__in' => array( $tag_id ) ) );
|
||||
$this->assertNotEmpty( $q3 );
|
||||
$q4 = get_posts( array( 'tag__in' => array() ) );
|
||||
$this->assertEmpty( $q4 );
|
||||
$this->assertNotEmpty( $q4 );
|
||||
|
||||
$q5 = get_posts( array( 'tag_slug__in' => array( $slug ) ) );
|
||||
$this->assertNotEmpty( $q5 );
|
||||
$q6 = get_posts( array( 'tag_slug__in' => array() ) );
|
||||
$this->assertEmpty( $q6 );
|
||||
$this->assertNotEmpty( $q6 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user