Skip to content

Commit

Permalink
Update test cases by adding output control function in output
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Feb 16, 2022
1 parent b80cd85 commit 661946f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public function test_wp_service_worker_offline_page_reload() {
$error_template_url = add_query_arg( 'wp_error_template', 'offline', home_url( '/', 'relative' ) );
$this->go_to( $error_template_url );

$actual_script = wp_service_worker_offline_page_reload();
ob_start();
wp_service_worker_offline_page_reload();
$actual_script = ob_get_clean();
$this->assertEquals( $_SERVER['REQUEST_METHOD'], 'GET' );
$this->assertTrue( is_offline() );
$this->assertFalse( is_500() );
Expand All @@ -42,7 +44,9 @@ public function test_wp_service_worker_offline_page_reload() {
$error_template_url = add_query_arg( 'wp_error_template', '500', home_url( '/', 'relative' ) );
$this->go_to( $error_template_url );

$actual_script = wp_service_worker_offline_page_reload();
ob_start();
wp_service_worker_offline_page_reload();
$actual_script = ob_get_clean();
$this->assertEquals( $_SERVER['REQUEST_METHOD'], 'GET' );
$this->assertFalse( is_offline() );
$this->assertTrue( is_500() );
Expand Down

0 comments on commit 661946f

Please sign in to comment.