Skip to content

Commit

Permalink
Switch to alternative approach to handle potential test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
anomiex authored and jeherve committed Sep 17, 2020
1 parent 83fb164 commit d56a0a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/blocks/tests/php/test-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ public function test_block_classes_invalid_align() {
*/
public function test_is_amp_request() {
add_filter( 'jetpack_is_amp_request', '__return_true' );
$is_amp = Blocks::is_amp_request();
remove_filter( 'jetpack_is_amp_request', '__return_true' );

$this->assertTrue( $is_amp );
try {
$this->assertTrue( Blocks::is_amp_request() );
} finally {
remove_filter( 'jetpack_is_amp_request', '__return_true' );
}
}

/**
Expand Down

0 comments on commit d56a0a9

Please sign in to comment.