| 525 | |
| 526 | /** |
| 527 | * @ticket 35619 |
| 528 | */ |
| 529 | public function test_query_two_custom_taxonomies() { |
| 530 | register_taxonomy( 'tax1', 'post' ); |
| 531 | register_taxonomy( 'tax2', 'post' ); |
| 532 | |
| 533 | $term1 = $this->factory->term->create( array( 'taxonomy' => 'tax1', 'name' => 'term1' ) ); |
| 534 | $term2 = $this->factory->term->create( array( 'taxonomy' => 'tax2', 'name' => 'term2' ) ); |
| 535 | $post_id = $this->factory->post->create(); |
| 536 | wp_set_object_terms( $post_id, 'term1', 'tax1' ); |
| 537 | wp_set_object_terms( $post_id, 'term2', 'tax2' ); |
| 538 | |
| 539 | $this->assertTrue( is_object_in_term( $post_id, 'tax1' , $term1 ) ); |
| 540 | $this->assertTrue( is_object_in_term( $post_id, 'tax2' , $term2 ) ); |
| 541 | |
| 542 | $this->go_to( home_url('?tax1=term1&tax2=term2') ); |
| 543 | $queried_object = get_queried_object(); |
| 544 | |
| 545 | $this->assertEquals( get_query_var('taxonomy'), $queried_object->taxonomy ); |
| 546 | $this->assertEquals( get_query_var('term'), $queried_object->slug ); |
| 547 | } |