From c27036163102c5fb8ba1d25cc75c2139fcbea37a Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Sat, 11 Nov 2023 17:50:49 -0800 Subject: [PATCH] Update assertion for older PHP+WP version compatibility. --- tests/phpunit/tests/Plugin_Tests.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/phpunit/tests/Plugin_Tests.php b/tests/phpunit/tests/Plugin_Tests.php index 519501e..620887b 100644 --- a/tests/phpunit/tests/Plugin_Tests.php +++ b/tests/phpunit/tests/Plugin_Tests.php @@ -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 ); }