|
@@ 536-551 (lines=16) @@
|
| 533 |
|
/** |
| 534 |
|
* @ticket 31118 |
| 535 |
|
*/ |
| 536 |
|
public function test_child_of_should_respect_multiple_taxonomies() |
| 537 |
|
{ |
| 538 |
|
register_taxonomy('wptests_tax1', 'post', array( 'hierarchical' => true )); |
| 539 |
|
register_taxonomy('wptests_tax2', 'post', array( 'hierarchical' => true )); |
| 540 |
|
|
| 541 |
|
$t1 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax1' )); |
| 542 |
|
$t2 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax2' )); |
| 543 |
|
$t3 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax2', 'parent' => $t2 )); |
| 544 |
|
|
| 545 |
|
$found = get_terms( |
| 546 |
|
array( 'wptests_tax1', 'wptests_tax2' ), array( |
| 547 |
|
'fields' => 'ids', |
| 548 |
|
'hide_empty' => false, |
| 549 |
|
'child_of' => $t2, |
| 550 |
|
) |
| 551 |
|
); |
| 552 |
|
|
| 553 |
|
$this->assertEqualSets(array( $t3 ), $found); |
| 554 |
|
} |
|
@@ 2002-2017 (lines=16) @@
|
| 1999 |
|
/** |
| 2000 |
|
* @ticket 31118 |
| 2001 |
|
*/ |
| 2002 |
|
public function test_parent_should_respect_multiple_taxonomies() |
| 2003 |
|
{ |
| 2004 |
|
register_taxonomy('wptests_tax1', 'post', array( 'hierarchical' => true )); |
| 2005 |
|
register_taxonomy('wptests_tax2', 'post', array( 'hierarchical' => true )); |
| 2006 |
|
|
| 2007 |
|
$t1 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax1' )); |
| 2008 |
|
$t2 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax2' )); |
| 2009 |
|
$t3 = self::factory()->term->create(array( 'taxonomy' => 'wptests_tax2', 'parent' => $t2 )); |
| 2010 |
|
|
| 2011 |
|
$found = get_terms( |
| 2012 |
|
array( 'wptests_tax1', 'wptests_tax2' ), array( |
| 2013 |
|
'fields' => 'ids', |
| 2014 |
|
'hide_empty' => false, |
| 2015 |
|
'parent' => $t2, |
| 2016 |
|
) |
| 2017 |
|
); |
| 2018 |
|
|
| 2019 |
|
$this->assertEqualSets(array( $t3 ), $found); |
| 2020 |
|
} |