Changeset 29931
- Timestamp:
- 10/16/2014 10:06:46 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r29915 r29931 1042 1042 1043 1043 if ( empty( $terms ) ) { 1044 continue;1044 return $sql; 1045 1045 } 1046 1046 … … 1056 1056 1057 1057 if ( empty( $terms ) ) { 1058 continue;1058 return $sql; 1059 1059 } 1060 1060 -
trunk/tests/phpunit/tests/term/query.php
r29902 r29931 353 353 } 354 354 355 /** 356 * @ticket 29738 357 */ 358 public function test_get_sql_operator_not_in_empty_terms() { 359 register_taxonomy( 'wptests_tax', 'post' ); 360 361 $tq = new WP_Tax_Query( array( 362 'relation' => 'OR', 363 array( 364 'taxonomy' => 'wptests_tax', 365 'field' => 'term_id', 366 'operator' => 'NOT IN', 367 'terms' => array(), 368 ), 369 ) ); 370 371 global $wpdb; 372 $expected = array( 373 'join' => '', 374 'where' => '', 375 ); 376 377 $this->assertSame( $expected, $tq->get_sql( $wpdb->posts, 'ID' ) ); 378 379 _unregister_taxonomy( 'wptests_tax' ); 380 } 381 382 /** 383 * @ticket 29738 384 */ 385 public function test_get_sql_operator_and_empty_terms() { 386 register_taxonomy( 'wptests_tax', 'post' ); 387 388 $tq = new WP_Tax_Query( array( 389 'relation' => 'OR', 390 array( 391 'taxonomy' => 'wptests_tax', 392 'field' => 'term_id', 393 'operator' => 'AND', 394 'terms' => array(), 395 ), 396 ) ); 397 398 global $wpdb; 399 $expected = array( 400 'join' => '', 401 'where' => '', 402 ); 403 404 $this->assertSame( $expected, $tq->get_sql( $wpdb->posts, 'ID' ) ); 405 406 _unregister_taxonomy( 'wptests_tax' ); 407 } 355 408 }
Note: See TracChangeset
for help on using the changeset viewer.