Changeset 29902 for trunk/tests/phpunit/tests/post/query.php
- Timestamp:
- 10/15/2014 04:39:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/query.php
r29896 r29902 1377 1377 /** 1378 1378 * @group taxonomy 1379 * @ticket 18105 1380 */ 1381 public function test_tax_query_single_query_multiple_queries_operator_not_in() { 1382 $t1 = $this->factory->term->create( array( 1383 'taxonomy' => 'category', 1384 'slug' => 'foo', 1385 'name' => 'Foo', 1386 ) ); 1387 $t2 = $this->factory->term->create( array( 1388 'taxonomy' => 'category', 1389 'slug' => 'bar', 1390 'name' => 'Bar', 1391 ) ); 1392 $p1 = $this->factory->post->create(); 1393 $p2 = $this->factory->post->create(); 1394 $p3 = $this->factory->post->create(); 1395 1396 wp_set_post_terms( $p1, $t1, 'category' ); 1397 wp_set_post_terms( $p2, $t2, 'category' ); 1398 1399 $q = new WP_Query( array( 1400 'fields' => 'ids', 1401 'update_post_meta_cache' => false, 1402 'update_post_term_cache' => false, 1403 'tax_query' => array( 1404 'relation' => 'AND', 1405 array( 1406 'taxonomy' => 'category', 1407 'terms' => array( 'foo' ), 1408 'field' => 'slug', 1409 'operator' => 'NOT IN', 1410 ), 1411 array( 1412 'taxonomy' => 'category', 1413 'terms' => array( 'bar' ), 1414 'field' => 'slug', 1415 'operator' => 'NOT IN', 1416 ), 1417 ), 1418 ) ); 1419 1420 $this->assertEquals( array( $p3 ), $q->posts ); 1421 } 1422 1423 /** 1424 * @group taxonomy 1379 1425 */ 1380 1426 public function test_tax_query_single_query_multiple_terms_operator_and() {
Note: See TracChangeset
for help on using the changeset viewer.