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
This commit is contained in:
Sergey Biryukov 2021-07-16 19:13:11 +00:00
parent bec8574024
commit bf3d6dd642
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class Tests_Post_Nav_Menu extends WP_UnitTestCase {
)
);
$this->assertSame( 0, strpos( $menu, '<ul' ) );
$this->assertStringStartsWith( '<ul', $menu );
}
function test_wp_get_associated_nav_menu_items() {

View File

@ -250,7 +250,7 @@ class Tests_URL extends WP_UnitTestCase {
$home_https = str_replace( 'http://', 'https://', $home );
// is_ssl() should determine the scheme in the admin.
$this->assertSame( 0, strpos( $home, 'http://' ) );
$this->assertStringStartsWith( 'http://', $home );
$_SERVER['HTTPS'] = 'on';
$this->assertSame( $home_https, network_home_url() );