Skip to content

Commit

Permalink
Add title in OptionsMenu tests before rendering settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Sep 12, 2023
1 parent 308e17c commit 1e8de9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/php/src/Admin/OptionsMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ public function test_render_screen_for_admin_user() {
)
);

// Set current screen to be the options menu.
set_current_screen( $this->instance->screen_handle() );

// Set title to be used in the screen.
global $title;
$title = 'Test Title';

ob_start();
$this->instance->render_screen();
$this->assertStringContainsString( '<div class="wrap">', ob_get_clean() );
Expand Down

0 comments on commit 1e8de9a

Please sign in to comment.