From 60b307b941ca15b22a1ec4b9c84cb7578c7401e0 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 29 Feb 2016 20:30:04 +0000 Subject: [PATCH] Make sure an assertion takes place in 'visited' test for `get_category_parents()`. See #36016. git-svn-id: https://develop.svn.wordpress.org/trunk@36778 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/category/getCategoryParents.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/category/getCategoryParents.php b/tests/phpunit/tests/category/getCategoryParents.php index 9805de9e29..35253921f7 100644 --- a/tests/phpunit/tests/category/getCategoryParents.php +++ b/tests/phpunit/tests/category/getCategoryParents.php @@ -50,7 +50,7 @@ class Tests_Category_GetCategoryParents extends WP_UnitTestCase { $this->assertSame( $expected, $found ); } - public function test_visited() { + public function test_visited_should_also_exclude_children_of_visited_categories() { $c3 = self::factory()->category->create_and_get( array( 'parent' => $this->c2->term_id, ) ); @@ -58,7 +58,8 @@ class Tests_Category_GetCategoryParents extends WP_UnitTestCase { 'parent' => $c3->term_id, ) ); - $expected = $this->c1->name . '/'. $this->c2->name . '/' . $c4->name . '/'; + $expected = $this->c1->name . '/'. $this->c2->name . '/'; $found = get_category_parents( $this->c2->term_id, false, '/', false, array( $c3->term_id ) ); + $this->assertSame( $expected, $found ); } }