File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,13 +76,27 @@ public function testRenderPageDropdownOutputsSelectElement(): void
7676 $ this ->assertStringContainsString ('_use_slug ' , $ output );
7777 }
7878
79- public function testAddPostTypeSubmenusAddsSubmenus (): void
79+ public function testAddPostSubmenusAddsSubmenus (): void
80+ {
81+ $ postsPageId = static ::factory ()->post ->create (['post_type ' => 'page ' , 'post_status ' => 'publish ' ]);
82+ update_option ('page_for_posts ' , $ postsPageId );
83+
84+ $ this ->acting_as ('administrator ' );
85+
86+ $ this ->admin ->addPostTypeSubmenus ();
87+
88+ // Check submenus was added for posts
89+ $ postMenuKey = 'edit.php ' ;
90+ $ this ->assertArrayHasKey ($ postMenuKey , $ GLOBALS ['submenu ' ] ?? []);
91+ }
92+
93+ public function testAddCustomPostTypeSubmenusAddsSubmenus (): void
8094 {
8195 $ this ->acting_as ('administrator ' );
8296
8397 $ this ->admin ->addPostTypeSubmenus ();
8498
85- // Check submenus were added for at least one post type
99+ // Check submenus were added for at least one custom post type
86100 $ bookMenuKey = 'edit.php?post_type= ' . self ::BOOK_POST_TYPE ;
87101 $ this ->assertArrayHasKey ($ bookMenuKey , $ GLOBALS ['submenu ' ] ?? []);
88102 }
You can’t perform that action at this time.
0 commit comments