Changeset 47122 for trunk/tests/phpunit/tests/query/taxQuery.php
- Timestamp:
- 01/29/2020 12:43:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/taxQuery.php
r46586 r47122 995 995 996 996 /** 997 * An empty tax query should return an empty array, not all posts. 998 * 997 999 * @ticket 20604 998 1000 */ 999 1001 public function test_tax_query_relation_or_both_clauses_empty_terms() { 1000 // An empty tax query should return an empty array, not all posts.1001 1002 1002 self::factory()->post->create_many( 2 ); 1003 1003 … … 1030 1030 1031 1031 /** 1032 * An empty tax query should return an empty array, not all posts. 1033 * 1032 1034 * @ticket 20604 1033 1035 */ 1034 1036 public function test_tax_query_relation_or_one_clause_empty_terms() { 1035 // An empty tax query should return an empty array, not all posts.1036 1037 1037 self::factory()->post->create_many( 2 ); 1038 1038 … … 1302 1302 $tags = array(); 1303 1303 1304 // need term_taxonomy_ids in addition to term_ids, so no factory1304 // Need term_taxonomy_ids in addition to term_ids, so no factory. 1305 1305 for ( $i = 0; $i < 5; $i++ ) { 1306 1306 $cats[ $i ] = wp_insert_term( 'category-' . $i, 'category' ); 1307 1307 $tags[ $i ] = wp_insert_term( 'tag-' . $i, 'post_tag' ); 1308 1308 1309 // post 0 gets all terms1309 // Post 0 gets all terms. 1310 1310 wp_set_object_terms( $posts[0], array( $cats[ $i ]['term_id'] ), 'category', true ); 1311 1311 wp_set_object_terms( $posts[0], array( $tags[ $i ]['term_id'] ), 'post_tag', true ); … … 1395 1395 array( 1396 1396 'tax_query' => array( 1397 // Empty terms mean that this one should be skipped 1397 // Empty terms mean that this one should be skipped. 1398 1398 array( 1399 1399 'taxonomy' => 'bar', … … 1401 1401 ), 1402 1402 1403 // Category and post tags should be skipped 1403 // Category and post tags should be skipped. 1404 1404 array( 1405 1405 'taxonomy' => 'category', … … 1519 1519 array( 1520 1520 'tax_query' => array( 1521 // Non-category should be skipped 1521 // Non-category should be skipped. 1522 1522 array( 1523 1523 'taxonomy' => 'foo', … … 1525 1525 ), 1526 1526 1527 // Empty terms mean that this one should be skipped 1527 // Empty terms mean that this one should be skipped. 1528 1528 array( 1529 1529 'taxonomy' => 'category', … … 1531 1531 ), 1532 1532 1533 // Category and post tags should be skipped 1533 // Category and post tags should be skipped. 1534 1534 array( 1535 1535 'taxonomy' => 'category', … … 1566 1566 array( 1567 1567 'tax_query' => array( 1568 // Non-tag should be skipped 1568 // Non-tag should be skipped. 1569 1569 array( 1570 1570 'taxonomy' => 'foo', … … 1572 1572 ), 1573 1573 1574 // Empty terms mean that this one should be skipped 1574 // Empty terms mean that this one should be skipped. 1575 1575 array( 1576 1576 'taxonomy' => 'post_tag', … … 1578 1578 ), 1579 1579 1580 // Category and post tags should be skipped 1580 // Category and post tags should be skipped. 1581 1581 array( 1582 1582 'taxonomy' => 'post_tag',
Note: See TracChangeset
for help on using the changeset viewer.