Skip to content

Commit 1e8de9a

Browse files
committed
Add title in OptionsMenu tests before rendering settings page
1 parent 308e17c commit 1e8de9a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/php/src/Admin/OptionsMenuTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,13 @@ public function test_render_screen_for_admin_user() {
290290
)
291291
);
292292

293+
// Set current screen to be the options menu.
294+
set_current_screen( $this->instance->screen_handle() );
295+
296+
// Set title to be used in the screen.
297+
global $title;
298+
$title = 'Test Title';
299+
293300
ob_start();
294301
$this->instance->render_screen();
295302
$this->assertStringContainsString( '<div class="wrap">', ob_get_clean() );

0 commit comments

Comments
 (0)