Tests: Remove redundant function_exists() check in a term_is_ancestor_of() test.

The function is available as of WordPress 3.4.

Follow-up to [19678], [493/tests].

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@54091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-09-07 14:05:41 +00:00
parent ff56396bf3
commit 8ec81ace60

View File

@ -138,10 +138,10 @@ class Tests_Term extends WP_UnitTestCase {
$this->assertIsArray( $t );
$t2 = wp_insert_term( $term, 'category', array( 'parent' => $t['term_id'] ) );
$this->assertIsArray( $t2 );
if ( function_exists( 'term_is_ancestor_of' ) ) {
$this->assertTrue( term_is_ancestor_of( $t['term_id'], $t2['term_id'], 'category' ) );
$this->assertFalse( term_is_ancestor_of( $t2['term_id'], $t['term_id'], 'category' ) );
}
$this->assertTrue( term_is_ancestor_of( $t['term_id'], $t2['term_id'], 'category' ) );
$this->assertFalse( term_is_ancestor_of( $t2['term_id'], $t['term_id'], 'category' ) );
$this->assertTrue( cat_is_ancestor_of( $t['term_id'], $t2['term_id'] ) );
$this->assertFalse( cat_is_ancestor_of( $t2['term_id'], $t['term_id'] ) );