Changeset 31207 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 01/16/2015 05:09:11 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/getTerms.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r31206 r31207 393 393 394 394 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); 395 } 396 397 /** 398 * @covers ::_get_term_children 399 * @ticket 24461 400 */ 401 public function test__get_term_children_handles_cycles() { 402 remove_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10 ); 403 404 $c1 = $this->factory->category->create(); 405 $c2 = $this->factory->category->create( array( 'parent' => $c1 ) ); 406 $c3 = $this->factory->category->create( array( 'parent' => $c2 ) ); 407 wp_update_term( $c1, 'category', array( 'parent' => $c3 ) ); 408 409 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); 410 411 $result = _get_term_children( $c1, array( $c1, $c2, $c3 ), 'category' ); 412 413 $this->assertEqualSets( array( $c2, $c3 ), $result ); 414 } 415 416 /** 417 * @covers ::_get_term_children 418 * @ticket 24461 419 */ 420 public function test__get_term_children_handles_cycles_when_terms_argument_contains_objects() { 421 remove_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10 ); 422 423 $c1 = $this->factory->category->create_and_get(); 424 $c2 = $this->factory->category->create_and_get( array( 'parent' => $c1->term_id ) ); 425 $c3 = $this->factory->category->create_and_get( array( 'parent' => $c2->term_id ) ); 426 wp_update_term( $c1->term_id, 'category', array( 'parent' => $c3->term_id ) ); 427 428 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); 429 430 $result = _get_term_children( $c1->term_id, array( $c1, $c2, $c3 ), 'category' ); 431 432 $this->assertEqualSets( array( $c2, $c3 ), $result ); 395 433 } 396 434
Note: See TracChangeset
for help on using the changeset viewer.