diff --git a/tests/phpunit/tests/term/cache.php b/tests/phpunit/tests/term/cache.php new file mode 100644 index 0000000000..d62b53bc4b --- /dev/null +++ b/tests/phpunit/tests/term/cache.php @@ -0,0 +1,32 @@ + Child + $term_id1 = $this->factory->category->create(); + $term_id1_child = $this->factory->category->create( array( 'parent' => $term_id1 ) ); + $hierarchy = _get_term_hierarchy( 'category' ); + + $this->assertEquals( array( $term_id1 => array( $term_id1_child ) ), $hierarchy ); + + // Add another Parent => Child + $term_id2 = $this->factory->category->create(); + $term_id2_child = $this->factory->category->create( array( 'parent' => $term_id2 ) ); + $hierarchy = _get_term_hierarchy( 'category' ); + + $this->assertEquals( array( $term_id1 => array( $term_id1_child ), $term_id2 => array( $term_id2_child ) ), $hierarchy ); + + } +} \ No newline at end of file