Changeset 35225 for trunk/tests/phpunit/tests/term/wpUpdateTerm.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpUpdateTerm.php
r34646 r35225 21 21 public function test_wp_update_term_unslash_name() { 22 22 register_taxonomy( 'wptests_tax', 'post' ); 23 $t = $this->factory->term->create( array(23 $t = self::$factory->term->create( array( 24 24 'taxonomy' => 'wptests_tax', 25 25 ) ); … … 37 37 public function test_wp_update_term_unslash_description() { 38 38 register_taxonomy( 'wptests_tax', 'post' ); 39 $t = $this->factory->term->create( array(39 $t = self::$factory->term->create( array( 40 40 'taxonomy' => 'wptests_tax', 41 41 ) ); … … 53 53 public function test_wp_update_term_name_empty_string() { 54 54 register_taxonomy( 'wptests_tax', 'post' ); 55 $t = $this->factory->term->create( array(55 $t = self::$factory->term->create( array( 56 56 'taxonomy' => 'wptests_tax', 57 57 ) ); … … 77 77 $this->assertNull( term_exists( $fake_term_id, 'wptests_tax' ) ); 78 78 79 $t = $this->factory->term->create( array(79 $t = self::$factory->term->create( array( 80 80 'taxonomy' => 'wptests_tax', 81 81 ) ); … … 95 95 public function test_wp_update_term_slug_empty_string_while_not_updating_name() { 96 96 register_taxonomy( 'wptests_tax', 'post' ); 97 $t = $this->factory->term->create( array(97 $t = self::$factory->term->create( array( 98 98 'taxonomy' => 'wptests_tax', 99 99 'name' => 'Foo Bar', … … 111 111 public function test_wp_update_term_slug_empty_string_while_updating_name() { 112 112 register_taxonomy( 'wptests_tax', 'post' ); 113 $t = $this->factory->term->create( array(113 $t = self::$factory->term->create( array( 114 114 'taxonomy' => 'wptests_tax', 115 115 ) ); … … 127 127 public function test_wp_update_term_slug_set_slug() { 128 128 register_taxonomy( 'wptests_tax', 'post' ); 129 $t = $this->factory->term->create( array(129 $t = self::$factory->term->create( array( 130 130 'taxonomy' => 'wptests_tax', 131 131 ) ); … … 146 146 register_taxonomy( 'wptests_tax', 'post' ); 147 147 148 $t1 = $this->factory->term->create( array(148 $t1 = self::$factory->term->create( array( 149 149 'name' => 'Foo', 150 150 'slug' => 'foo', … … 152 152 ) ); 153 153 154 $t2 = $this->factory->term->create( array(154 $t2 = self::$factory->term->create( array( 155 155 'name' => 'Bar', 156 156 'slug' => 'bar', … … 173 173 register_taxonomy( 'wptests_tax_2', 'post' ); 174 174 175 $t1 = $this->factory->term->create( array(175 $t1 = self::$factory->term->create( array( 176 176 'name' => 'Foo', 177 177 'slug' => 'foo', … … 179 179 ) ); 180 180 181 $t2 = $this->factory->term->create( array(181 $t2 = self::$factory->term->create( array( 182 182 'name' => 'Foo', 183 183 'slug' => 'bar', … … 203 203 register_taxonomy( 'wptests_tax_2', 'post' ); 204 204 205 $t1 = $this->factory->term->create( array(205 $t1 = self::$factory->term->create( array( 206 206 'name' => 'Foo', 207 207 'slug' => 'foo', … … 209 209 ) ); 210 210 211 $t2 = $this->factory->term->create( array(211 $t2 = self::$factory->term->create( array( 212 212 'name' => 'Bar', 213 213 'slug' => 'bar', … … 233 233 ) ); 234 234 235 $t1 = $this->factory->term->create( array(235 $t1 = self::$factory->term->create( array( 236 236 'name' => 'Foo', 237 237 'slug' => 'foo', … … 239 239 ) ); 240 240 241 $t2 = $this->factory->term->create( array(241 $t2 = self::$factory->term->create( array( 242 242 'name' => 'Bar', 243 243 'slug' => 'bar', … … 246 246 ) ); 247 247 248 $t3 = $this->factory->term->create( array(248 $t3 = self::$factory->term->create( array( 249 249 'name' => 'Bar Child', 250 250 'slug' => 'bar-child', … … 283 283 ); 284 284 285 $posts = $this->factory->post->create_many( 2 );285 $posts = self::$factory->post->create_many( 2 ); 286 286 wp_set_object_terms( $posts[0], array( 'Foo' ), 'wptests_tax' ); 287 287 wp_set_object_terms( $posts[1], array( 'Foo' ), 'wptests_tax_2' ); … … 303 303 public function test_wp_update_term_alias_of_no_term_group() { 304 304 register_taxonomy( 'wptests_tax', 'post' ); 305 $t1 = $this->factory->term->create( array(305 $t1 = self::$factory->term->create( array( 306 306 'taxonomy' => 'wptests_tax', 307 307 ) ); … … 324 324 public function test_wp_update_term_alias_of_existing_term_group() { 325 325 register_taxonomy( 'wptests_tax', 'post' ); 326 $t1 = $this->factory->term->create( array(326 $t1 = self::$factory->term->create( array( 327 327 'taxonomy' => 'wptests_tax', 328 328 ) ); 329 329 $term_1 = get_term( $t1, 'wptests_tax' ); 330 330 331 $t2 = $this->factory->term->create( array(331 $t2 = self::$factory->term->create( array( 332 332 'taxonomy' => 'wptests_tax', 333 333 'alias_of' => $term_1->slug, … … 360 360 public function test_wp_update_term_slug_same_as_old_slug() { 361 361 register_taxonomy( 'wptests_tax', 'post' ); 362 $t = $this->factory->term->create( array(362 $t = self::$factory->term->create( array( 363 363 'taxonomy' => 'wptests_tax', 364 364 'slug' => 'foo', … … 378 378 public function test_wp_update_term_duplicate_slug_generated_due_to_empty_slug_param() { 379 379 register_taxonomy( 'wptests_tax', 'post' ); 380 $t1 = $this->factory->term->create( array(380 $t1 = self::$factory->term->create( array( 381 381 'taxonomy' => 'wptests_tax', 382 382 'slug' => 'foo-bar', 383 383 ) ); 384 $t2 = $this->factory->term->create( array(384 $t2 = self::$factory->term->create( array( 385 385 'taxonomy' => 'wptests_tax', 386 386 'name' => 'not foo bar', … … 403 403 'hierarchical' => true, 404 404 ) ); 405 $p = $this->factory->term->create( array(406 'taxonomy' => 'wptests_tax', 407 ) ); 408 $t1 = $this->factory->term->create( array(405 $p = self::$factory->term->create( array( 406 'taxonomy' => 'wptests_tax', 407 ) ); 408 $t1 = self::$factory->term->create( array( 409 409 'taxonomy' => 'wptests_tax', 410 410 'slug' => 'foo-bar', 411 411 ) ); 412 $t2 = $this->factory->term->create( array(412 $t2 = self::$factory->term->create( array( 413 413 'taxonomy' => 'wptests_tax', 414 414 ) ); … … 429 429 public function test_wp_update_term_duplicate_slug_failure() { 430 430 register_taxonomy( 'wptests_tax', 'post' ); 431 $t1 = $this->factory->term->create( array(431 $t1 = self::$factory->term->create( array( 432 432 'taxonomy' => 'wptests_tax', 433 433 'slug' => 'foo-bar', 434 434 ) ); 435 $t2 = $this->factory->term->create( array(435 $t2 = self::$factory->term->create( array( 436 436 'taxonomy' => 'wptests_tax', 437 437 'slug' => 'my-old-slug', … … 452 452 public function test_wp_update_term_should_return_term_id_and_term_taxonomy_id() { 453 453 register_taxonomy( 'wptests_tax', 'post' ); 454 $t = $this->factory->term->create( array(454 $t = self::$factory->term->create( array( 455 455 'taxonomy' => 'wptests_tax', 456 456 ) ); … … 478 478 public function test_wp_update_term_should_return_int_values_for_term_id_and_term_taxonomy_id() { 479 479 register_taxonomy( 'wptests_tax', 'post' ); 480 $t = $this->factory->term->create( array(480 $t = self::$factory->term->create( array( 481 481 'taxonomy' => 'wptests_tax', 482 482 ) ); … … 492 492 register_taxonomy( 'wptests_tax_for_post', 'post' ); 493 493 register_taxonomy( 'wptests_tax_for_page', 'page' ); 494 $post = $this->factory->post->create();495 $page = $this->factory->post->create( array(494 $post = self::$factory->post->create(); 495 $page = self::$factory->post->create( array( 496 496 'post_type' => 'page', 497 497 ) ); 498 498 499 $t_for_post = $this->factory->term->create( array(499 $t_for_post = self::$factory->term->create( array( 500 500 'taxonomy' => 'wptests_tax_for_post', 501 501 ) ); 502 $t_for_page = $this->factory->term->create( array(502 $t_for_page = self::$factory->term->create( array( 503 503 'taxonomy' => 'wptests_tax_for_page', 504 504 ) ); … … 528 528 ) ); 529 529 530 $t1 = $this->factory->term->create( array(531 'taxonomy' => 'wptests_tax', 532 ) ); 533 $t2 = $this->factory->term->create( array(530 $t1 = self::$factory->term->create( array( 531 'taxonomy' => 'wptests_tax', 532 ) ); 533 $t2 = self::$factory->term->create( array( 534 534 'taxonomy' => 'wptests_tax', 535 535 ) ); … … 568 568 ) ); 569 569 570 $t1 = $this->factory->term->create( array(570 $t1 = self::$factory->term->create( array( 571 571 'taxonomy' => 'wptests_tax', 572 572 'slug' => 'parent-term', 573 573 ) ); 574 574 575 $t2 = $this->factory->term->create( array(575 $t2 = self::$factory->term->create( array( 576 576 'taxonomy' => 'wptests_tax', 577 577 'slug' => 'foo', … … 600 600 ) ); 601 601 602 $t1 = $this->factory->term->create( array(602 $t1 = self::$factory->term->create( array( 603 603 'taxonomy' => 'wptests_tax', 604 604 'slug' => 'parent-term', … … 606 606 607 607 // Same slug but in a different tax. 608 $t2 = $this->factory->term->create( array(608 $t2 = self::$factory->term->create( array( 609 609 'taxonomy' => 'wptests_tax_2', 610 610 'slug' => 'foo', 611 611 ) ); 612 612 613 $t3 = $this->factory->term->create( array(613 $t3 = self::$factory->term->create( array( 614 614 'taxonomy' => 'wptests_tax', 615 615 'slug' => 'foo', … … 631 631 */ 632 632 public function test_wp_update_term_with_null_get_term() { 633 $t = $this->factory->term->create( array( 'taxonomy' => 'category' ) );633 $t = self::$factory->term->create( array( 'taxonomy' => 'category' ) ); 634 634 $found = wp_update_term( $t, 'post_tag', array( 'slug' => 'foo' ) ); 635 635
Note: See TracChangeset
for help on using the changeset viewer.