diff --git a/tests/phpunit/tests/functions/wpFindHierarchyLoop.php b/tests/phpunit/tests/functions/wpFindHierarchyLoop.php new file mode 100644 index 0000000000000..12621844b4609 --- /dev/null +++ b/tests/phpunit/tests/functions/wpFindHierarchyLoop.php @@ -0,0 +1,46 @@ + true, + 2 => true, + ); + $this->assertSame( $expected, $result ); + } + + /** + * @ticket 59901 + */ + public function test_wp_find_hierarchy_loop_null_parent() { + $result = wp_find_hierarchy_loop( + static function ( $id ) { + return 1; + }, + 1, + null + ); + $expected = array( + 1 => true, + ); + $this->assertSame( $expected, $result ); + } +}