From baa7174b3a9a0e5c5d8f29378119c2d73955994c Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Mon, 28 Nov 2022 19:21:07 -0500 Subject: [PATCH 01/14] tests for wp_widgets_add_menu --- .../tests/functions/wpWidgetsAddMenu.php | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/phpunit/tests/functions/wpWidgetsAddMenu.php diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php new file mode 100644 index 0000000000000..ccb36682d9cb0 --- /dev/null +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -0,0 +1,70 @@ +assertSame( $current_submenu, $update_submenu, 'no widget theme support so not menu added' ); + } + + /** + * @ticket 57224 + */ + public function test_wp_widgets_add_menu_if__widget_support_should_add_submenu() { + global $submenu; + $current_submenu = $submenu; + $widget_support = current_theme_supports( 'widgets' ); + + add_theme_support( 'widgets' ); + wp_widgets_add_menu(); + $update_submenu = $submenu; + if ( ! $widget_support ) { + remove_theme_support( 'widgets' ); + } + // reset the global variable + $submenu = $current_submenu; + $expected['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); + $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); + } + + /** + * @ticket 57224 + */ + public function test_wp_widgets_add_menu_if_block_template_parts_should_add_submenu() { + global $submenu; + $current_submenu = $submenu; + $block_support = current_theme_supports( 'block-template-parts' ); + + add_theme_support( 'block-template-parts' ); + wp_widgets_add_menu(); + $update_submenu = $submenu; + if ( ! $block_support ) { + remove_theme_support( 'block-template-parts' ); + } + // reset the global variable + $submenu = $current_submenu; + $expected['themes.php'][] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); + $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); + } +} From 972ccf974cad7837db8ba52fba28178379ff5b44 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:13:59 -0500 Subject: [PATCH 02/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index ccb36682d9cb0..0952d8dfc13c4 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -6,7 +6,7 @@ * * @covers ::wp_widgets_add_menu */# -class Tests_functions_WpWidgetsAddMenu extends WP_UnitTestCase { +class Tests_Functions_WpWidgetsAddMenu extends WP_UnitTestCase { /** * @ticket 57224 From cc30031a6b4b843012f39de422f25d28d0dffc51 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:13 -0500 Subject: [PATCH 03/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 0952d8dfc13c4..e2f9629f3a844 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -5,7 +5,7 @@ * @group functions.php * * @covers ::wp_widgets_add_menu - */# + */ class Tests_Functions_WpWidgetsAddMenu extends WP_UnitTestCase { /** From 3c98066f94e0b2f10a07798f9a4767c84cf72584 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:18 -0500 Subject: [PATCH 04/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index e2f9629f3a844..b17d85952391a 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -23,7 +23,7 @@ public function test_wp_widgets_add_menu_if_no_widget_support_should_not_add_sub if ( $widget_support ) { add_theme_support( 'widgets' ); } - // reset the global variable + // Reset the global variable. $submenu = $current_submenu; $this->assertSame( $current_submenu, $update_submenu, 'no widget theme support so not menu added' ); } From 4e8ef3c961fcb9a4ea00f1dd81f9cbf83d7cffc1 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:24 -0500 Subject: [PATCH 05/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index b17d85952391a..30146c3d8075d 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -15,7 +15,7 @@ public function test_wp_widgets_add_menu_if_no_widget_support_should_not_add_sub global $submenu; $widget_support = current_theme_supports( 'widgets' ); $current_submenu = $submenu; - // have to use the private call and the public does not allow to remove the widgets support. + // Have to use the private call and the public does not allow to remove the widgets support. _remove_theme_support( 'widgets' ); wp_widgets_add_menu(); From 2cbe377447726be1287e0a0c814aba4053e6a2a4 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:31 -0500 Subject: [PATCH 06/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 30146c3d8075d..4f7ca556048c7 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -42,7 +42,7 @@ public function test_wp_widgets_add_menu_if__widget_support_should_add_submenu() if ( ! $widget_support ) { remove_theme_support( 'widgets' ); } - // reset the global variable + // Reset the global variable. $submenu = $current_submenu; $expected['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); From c67bd690f14b15d3dfd4df49dc2fd28680dc4aeb Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:37 -0500 Subject: [PATCH 07/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 4f7ca556048c7..860a18a136b7f 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -62,7 +62,7 @@ public function test_wp_widgets_add_menu_if_block_template_parts_should_add_subm if ( ! $block_support ) { remove_theme_support( 'block-template-parts' ); } - // reset the global variable + // Reset the global variable. $submenu = $current_submenu; $expected['themes.php'][] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); From 5c648c23ec4cf61c49533d424cdec8fb951145f8 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 2 Dec 2022 15:14:45 -0500 Subject: [PATCH 08/14] Update tests/phpunit/tests/functions/wpWidgetsAddMenu.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 860a18a136b7f..fc76fd45e2851 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -25,7 +25,7 @@ public function test_wp_widgets_add_menu_if_no_widget_support_should_not_add_sub } // Reset the global variable. $submenu = $current_submenu; - $this->assertSame( $current_submenu, $update_submenu, 'no widget theme support so not menu added' ); + $this->assertSame( $current_submenu, $update_submenu, 'theme did not support widgets so menu item not added' ); } /** From abd070d976803985e6cba935b03309cb642f4f21 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Wed, 4 Nov 2026 16:18:23 -0500 Subject: [PATCH 09/14] Fix theme support removal in wp_widgets_add_menu test Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index fc76fd45e2851..5d9aae85307be 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -34,13 +34,14 @@ public function test_wp_widgets_add_menu_if_no_widget_support_should_not_add_sub public function test_wp_widgets_add_menu_if__widget_support_should_add_submenu() { global $submenu; $current_submenu = $submenu; + $submenu = array(); $widget_support = current_theme_supports( 'widgets' ); add_theme_support( 'widgets' ); wp_widgets_add_menu(); $update_submenu = $submenu; if ( ! $widget_support ) { - remove_theme_support( 'widgets' ); + _remove_theme_support( 'widgets' ); } // Reset the global variable. $submenu = $current_submenu; From 46bcef8b38c0b377b7bf31c23ba07032a8df960d Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Wed, 4 Nov 2026 16:29:11 -0500 Subject: [PATCH 10/14] Refactor and enhance `wp_widgets_add_menu` tests: - Improve test structure and clarity. - Add setup and teardown methods to manage global `$submenu`. - Cover additional scenarios for widget and block theme support. --- .../tests/functions/wpWidgetsAddMenu.php | 110 +++++++++++------- 1 file changed, 71 insertions(+), 39 deletions(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 5d9aae85307be..f67c69e6dc66e 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -1,71 +1,103 @@ original_submenu = $submenu; + $submenu = array(); + } + + /** + * Restores the test fixture. + */ + public function tear_down() { + global $submenu; + $submenu = $this->original_submenu; + parent::tear_down(); + } + + /** + * Tests that wp_widgets_add_menu() adds a submenu item for classic themes. + * * @ticket 57224 + * @ticket 60179 */ - public function test_wp_widgets_add_menu_if_no_widget_support_should_not_add_submenu() { + public function test_wp_widgets_add_menu() { global $submenu; - $widget_support = current_theme_supports( 'widgets' ); - $current_submenu = $submenu; - // Have to use the private call and the public does not allow to remove the widgets support. - _remove_theme_support( 'widgets' ); wp_widgets_add_menu(); - $update_submenu = $submenu; - if ( $widget_support ) { - add_theme_support( 'widgets' ); - } - // Reset the global variable. - $submenu = $current_submenu; - $this->assertSame( $current_submenu, $update_submenu, 'theme did not support widgets so menu item not added' ); + + $expected = array( + 'themes.php' => array( + 7 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + ), + ); + $this->assertSame( $expected, $submenu ); } /** + * Tests that wp_widgets_add_menu() does not add a submenu item when the theme does not support widgets. + * * @ticket 57224 + * @ticket 60179 */ - public function test_wp_widgets_add_menu_if__widget_support_should_add_submenu() { + public function test_wp_widgets_add_menu_no_widget_support() { global $submenu; - $current_submenu = $submenu; - $submenu = array(); - $widget_support = current_theme_supports( 'widgets' ); - add_theme_support( 'widgets' ); + add_filter( 'current_theme_supports-widgets', '__return_false' ); + wp_widgets_add_menu(); - $update_submenu = $submenu; - if ( ! $widget_support ) { - _remove_theme_support( 'widgets' ); - } - // Reset the global variable. - $submenu = $current_submenu; - $expected['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); - $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); + + remove_filter( 'current_theme_supports-widgets', '__return_false' ); + + $this->assertSame( array(), $submenu ); } /** + * Tests that wp_widgets_add_menu() appends a submenu item for block themes. + * * @ticket 57224 + * @ticket 60179 */ - public function test_wp_widgets_add_menu_if_block_template_parts_should_add_submenu() { + public function test_wp_widgets_add_menu_block_theme() { global $submenu; - $current_submenu = $submenu; - $block_support = current_theme_supports( 'block-template-parts' ); - add_theme_support( 'block-template-parts' ); + switch_theme( 'block-theme' ); + wp_widgets_add_menu(); - $update_submenu = $submenu; - if ( ! $block_support ) { - remove_theme_support( 'block-template-parts' ); - } - // Reset the global variable. - $submenu = $current_submenu; - $expected['themes.php'][] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); - $this->assertSame( $update_submenu, $expected, 'theme support widgets so menu item added' ); + + $expected = array( + 'themes.php' => array( + array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + ), + ); + $this->assertSame( $expected, $submenu ); } } From 7f634b9f2f9947dc3f527a2bd731b442f122c330 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 5 Nov 2026 12:40:46 -0500 Subject: [PATCH 11/14] Update submenu index for Widgets in wpWidgetsAddMenu Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index f67c69e6dc66e..20d7d4f0d8120 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -56,7 +56,7 @@ public function test_wp_widgets_add_menu() { $expected = array( 'themes.php' => array( - 7 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + 9 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), ), ); $this->assertSame( $expected, $submenu ); From d3829a1de83daf142ff1cd88333baa47f83f707a Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 5 Nov 2026 12:44:45 -0500 Subject: [PATCH 12/14] Add 'Themes' submenu item to wpWidgetsAddMenu test Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 20d7d4f0d8120..8a35ad8d9b964 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -91,11 +91,16 @@ public function test_wp_widgets_add_menu_block_theme() { switch_theme( 'block-theme' ); + $submenu['themes.php'] = array( + 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), + ); + wp_widgets_add_menu(); $expected = array( 'themes.php' => array( - array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), + 6 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), ), ); $this->assertSame( $expected, $submenu ); From a415959d5853129d01263403fcbff75cc38895d8 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 5 Nov 2026 16:37:39 -0500 Subject: [PATCH 13/14] Update submenu in wp_widgets_add_menu test Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tests/phpunit/tests/functions/wpWidgetsAddMenu.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 8a35ad8d9b964..17d24cd7620f5 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -52,11 +52,18 @@ public function tear_down() { public function test_wp_widgets_add_menu() { global $submenu; + $submenu['themes.php'] = array( + 11 => array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ), + 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), + ); + wp_widgets_add_menu(); $expected = array( 'themes.php' => array( - 9 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), + 9 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + 11 => array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ), ), ); $this->assertSame( $expected, $submenu ); From fe98342138dd0e6cdb11fc10954745770e29eca4 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Mon, 9 Nov 2026 14:55:17 -0500 Subject: [PATCH 14/14] Tests: Improve wp_widgets_add_menu() coverage and reliability --- .../tests/functions/wpWidgetsAddMenu.php | 61 ++++++++++++------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php index 17d24cd7620f5..c3c690b9fc0f8 100644 --- a/tests/phpunit/tests/functions/wpWidgetsAddMenu.php +++ b/tests/phpunit/tests/functions/wpWidgetsAddMenu.php @@ -48,25 +48,32 @@ public function tear_down() { * * @ticket 57224 * @ticket 60179 + * + * @runInSeparateProcess + * @preserveGlobalState disabled */ public function test_wp_widgets_add_menu() { - global $submenu; + global $menu, $submenu; - $submenu['themes.php'] = array( - 11 => array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ), - 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), - ); + $admin_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); + wp_set_current_user( $admin_id ); + + remove_action( '_admin_menu', 'wp_widgets_add_menu' ); + + require_once ABSPATH . 'wp-admin/menu.php'; + + $submenu_before = $submenu['themes.php']; wp_widgets_add_menu(); - $expected = array( - 'themes.php' => array( - 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), - 9 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), - 11 => array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ), - ), + foreach ( $submenu_before as $item ) { + $this->assertContains( $item, $submenu['themes.php'] ); + } + + $this->assertContains( + array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + $submenu['themes.php'] ); - $this->assertSame( $expected, $submenu ); } /** @@ -90,26 +97,36 @@ public function test_wp_widgets_add_menu_no_widget_support() { /** * Tests that wp_widgets_add_menu() appends a submenu item for block themes. * + * @ticket 54916 * @ticket 57224 * @ticket 60179 + * + * @runInSeparateProcess + * @preserveGlobalState disabled */ public function test_wp_widgets_add_menu_block_theme() { - global $submenu; + global $menu, $submenu; switch_theme( 'block-theme' ); - $submenu['themes.php'] = array( - 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), - ); + $admin_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); + wp_set_current_user( $admin_id ); + + remove_action( '_admin_menu', 'wp_widgets_add_menu' ); + + require_once ABSPATH . 'wp-admin/menu.php'; + + $submenu_before = $submenu['themes.php']; wp_widgets_add_menu(); - $expected = array( - 'themes.php' => array( - 5 => array( __( 'Themes' ), 'switch_themes', 'themes.php' ), - 6 => array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), - ), + foreach ( $submenu_before as $item ) { + $this->assertContains( $item, $submenu['themes.php'] ); + } + + $this->assertContains( + array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ), + $submenu['themes.php'] ); - $this->assertSame( $expected, $submenu ); } }