Skip to content

Commit

Permalink
Update assertion for older PHP+WP version compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Nov 12, 2023
1 parent 7d6427a commit c270361
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/phpunit/tests/Plugin_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public function test_fast_smooth_scroll_register_scripts_does_not_print_offset_s
// Restore original `$wp_scripts`.
$wp_scripts = $orig_wp_scripts;

if ( ! method_exists( $this, 'assertStringNotContainsString' ) ) {
$this->assertFalse( strpos( $polyfill_inline_script, 'var fastSmoothScrollOffset = ' ) );
$this->assertFalse( strpos( $polyfills_inline_script, 'var fastSmoothScrollOffset = ' ) );
return;
}

$this->assertStringNotContainsString( 'var fastSmoothScrollOffset = ', $polyfill_inline_script );
$this->assertStringNotContainsString( 'var fastSmoothScrollOffset = ', $polyfills_inline_script );
}
Expand Down

0 comments on commit c270361

Please sign in to comment.