From 416dc6642afd1364ab86cc07708133f3640b8c90 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Mon, 28 Sep 2015 00:46:19 +0000 Subject: [PATCH] Tests: Add a test for the 'before' and 'after' arguments in `wp_page_menu()` when used as a fallback for `wp_nav_menu()`. When `wp_page_menu()` is used as a fallback for `wp_nav_menu()`, the `before` and `after` arguments should be set and output as ``, respectively. See #11095. See [34653]. git-svn-id: https://develop.svn.wordpress.org/trunk@34654 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/template.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/phpunit/tests/post/template.php b/tests/phpunit/tests/post/template.php index 41c2be7bbc..7fe86c047b 100644 --- a/tests/phpunit/tests/post/template.php +++ b/tests/phpunit/tests/post/template.php @@ -1,5 +1,8 @@ go_to( get_permalink( $post_id ) ); $this->assertFalse( get_page_template_slug() ); } + + /** + * @ticket 11095 + */ + public function test_wp_page_menu_wp_nav_menu_fallback() { + $pages = $this->factory->post->create_many( 3, array( 'post_type' => 'page' ) ); + + // No menus + wp_nav_menu() falls back to wp_page_menu(). + $menu = wp_nav_menu( array( 'echo' => false ) ); + + // After falling back, the 'before' argument should be set and output as '