From bf3d6dd6423dc4c1eb79f898de04816b20dbf70e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 16 Jul 2021 19:13:11 +0000 Subject: [PATCH] Tests: Use more appropriate assertions in various tests. This replaces instances of `assertSame( 0, strpos( ... ) )` with `assertStringStartsWith()` to use native PHPUnit functionality. Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51449 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/nav-menu.php | 2 +- tests/phpunit/tests/url.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/post/nav-menu.php b/tests/phpunit/tests/post/nav-menu.php index 3153853159..08241af64e 100644 --- a/tests/phpunit/tests/post/nav-menu.php +++ b/tests/phpunit/tests/post/nav-menu.php @@ -40,7 +40,7 @@ class Tests_Post_Nav_Menu extends WP_UnitTestCase { ) ); - $this->assertSame( 0, strpos( $menu, 'assertStringStartsWith( 'assertSame( 0, strpos( $home, 'http://' ) ); + $this->assertStringStartsWith( 'http://', $home ); $_SERVER['HTTPS'] = 'on'; $this->assertSame( $home_https, network_home_url() );