Changeset 35333 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 10/21/2015 04:53:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r35242 r35333 467 467 * @ticket 21949 468 468 */ 469 public function test_it_should_be_possible_to_register_a_query_var_that_matches_the_name_of_a_nonpublic_taxonomy() { 470 global $wp; 471 472 register_taxonomy( 'wptests_tax', 'post', array( 473 'public' => false, 474 ) ); 475 $t = $this->factory->term->create_and_get( array( 476 'taxonomy' => 'wptests_tax', 477 ) ); 478 479 $p = $this->factory->post->create(); 480 wp_set_object_terms( $p, $t->slug, 'wptests_tax' ); 481 482 add_filter( 'do_parse_request', array( $this, 'register_query_var' ) ); 483 $this->go_to( '/?wptests_tax=foo' ); 484 remove_filter( 'do_parse_request', array( $this, 'register_query_var' ) ); 485 486 // Not a taxonomy... 487 $this->assertFalse( is_tax( 'wptests_tax' ) ); 488 489 // ...but query var works. 490 $this->assertSame( 'foo', $wp->query_vars['wptests_tax'] ); 491 } 492 493 public static function register_query_var( $r ) { 494 global $wp; 495 496 $wp->add_query_var( 'wptests_tax' ); 497 498 return $r; 499 } 500 501 /** 502 * @ticket 21949 503 */ 469 504 public function test_nonpublic_taxonomy_should_not_be_queryable_using_taxonomy_and_term_vars() { 470 505 register_taxonomy( 'wptests_tax', 'post', array(
Note: See TracChangeset
for help on using the changeset viewer.