WordPress.org

Make WordPress Core

Changeset 51449


Ignore:
Timestamp:
07/16/2021 07:13:11 PM (2 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/tests/phpunit/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/nav-menu.php

    r51337 r51449  
    4141        );
    4242
    43         $this->assertSame( 0, strpos( $menu, '<ul' ) );
     43        $this->assertStringStartsWith( '<ul', $menu );
    4444    }
    4545
  • trunk/tests/phpunit/tests/url.php

    r51419 r51449  
    251251
    252252        // is_ssl() should determine the scheme in the admin.
    253         $this->assertSame( 0, strpos( $home, 'http://' ) );
     253        $this->assertStringStartsWith( 'http://', $home );
    254254        $_SERVER['HTTPS'] = 'on';
    255255        $this->assertSame( $home_https, network_home_url() );
Note: See TracChangeset for help on using the changeset viewer.