Changeset 36525 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 02/13/2016 03:50:37 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r36247 r36525 447 447 * @ticket 21949 448 448 */ 449 public function test_nonpublic _taxonomy_should_not_be_queryable_using_taxname_query_var() {449 public function test_nonpublicly_queryable_taxonomy_should_not_be_queryable_using_taxname_query_var() { 450 450 register_taxonomy( 'wptests_tax', 'post', array( 451 'public ' => false,451 'publicly_queryable' => false, 452 452 ) ); 453 453 … … 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() {469 public function test_it_should_be_possible_to_register_a_query_var_that_matches_the_name_of_a_nonpublicly_queryable_taxonomy() { 470 470 global $wp; 471 471 472 472 register_taxonomy( 'wptests_tax', 'post', array( 473 'public ' => false,473 'publicly_queryable' => false, 474 474 ) ); 475 475 $t = $this->factory->term->create_and_get( array( … … 502 502 * @ticket 21949 503 503 */ 504 public function test_nonpublic_taxonomy_should_not_be_queryable_using_taxonomy_and_term_vars() { 504 public function test_nonpublicly_queryable_taxonomy_should_not_be_queryable_using_taxonomy_and_term_vars() { 505 register_taxonomy( 'wptests_tax', 'post', array( 506 'publicly_queryable' => false, 507 ) ); 508 509 $t = self::factory()->term->create_and_get( array( 510 'taxonomy' => 'wptests_tax', 511 ) ); 512 513 $p = self::factory()->post->create(); 514 wp_set_object_terms( $p, $t->slug, 'wptests_tax' ); 515 516 $this->go_to( '/?taxonomy=wptests_tax&term=' . $t->slug ); 517 518 $this->assertFalse( is_tax( 'wptests_tax' ) ); 519 } 520 521 /** 522 * @ticket 34491 523 */ 524 public function test_public_taxonomy_should_be_publicly_queryable() { 525 register_taxonomy( 'wptests_tax', 'post', array( 526 'public' => true, 527 ) ); 528 529 $this->assertContains( 'wptests_tax', get_taxonomies( array( 'publicly_queryable' => true ) ) ); 530 531 $t = self::factory()->term->create_and_get( array( 532 'taxonomy' => 'wptests_tax', 533 ) ); 534 535 $p = self::factory()->post->create(); 536 wp_set_object_terms( $p, $t->slug, 'wptests_tax' ); 537 538 $this->go_to( '/?wptests_tax=' . $t->slug ); 539 540 $this->assertTrue( is_tax( 'wptests_tax' ) ); 541 } 542 543 /** 544 * @ticket 34491 545 */ 546 public function test_private_taxonomy_should_not_be_publicly_queryable() { 505 547 register_taxonomy( 'wptests_tax', 'post', array( 506 548 'public' => false, 507 549 ) ); 508 550 551 $this->assertContains( 'wptests_tax', get_taxonomies( array( 'publicly_queryable' => false ) ) ); 552 509 553 $t = self::factory()->term->create_and_get( array( 510 554 'taxonomy' => 'wptests_tax', … … 514 558 wp_set_object_terms( $p, $t->slug, 'wptests_tax' ); 515 559 516 $this->go_to( '/? taxonomy=wptests_tax&term=' . $t->slug );560 $this->go_to( '/?wptests_tax=' . $t->slug ); 517 561 518 562 $this->assertFalse( is_tax( 'wptests_tax' ) ); 563 } 564 565 /** 566 * @ticket 34491 567 */ 568 public function test_private_taxonomy_should_be_overridden_by_publicly_queryable() { 569 register_taxonomy( 'wptests_tax', 'post', array( 570 'public' => false, 571 'publicly_queryable' => true, 572 ) ); 573 574 $this->assertContains( 'wptests_tax', get_taxonomies( array( 'publicly_queryable' => true ) ) ); 575 576 $t = self::factory()->term->create_and_get( array( 577 'taxonomy' => 'wptests_tax', 578 ) ); 579 580 $p = self::factory()->post->create(); 581 wp_set_object_terms( $p, $t->slug, 'wptests_tax' ); 582 583 $this->go_to( '/?wptests_tax=' . $t->slug ); 584 585 $this->assertTrue( is_tax( 'wptests_tax' ) ); 519 586 } 520 587
Note: See TracChangeset
for help on using the changeset viewer.