Make WordPress Core


Ignore:
Timestamp:
07/12/2021 10:35:44 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( in_array( ... ) ) with assertContains() to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403].

Props hellofromTonya, jrf, SergeyBiryukov.
Fixes #53123. See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api.php

    r51397 r51404  
    266266        function test_rest_route_query_var() {
    267267                rest_api_init();
    268                 $this->assertTrue( in_array( 'rest_route', $GLOBALS['wp']->public_query_vars, true ) );
     268                $this->assertContains( 'rest_route', $GLOBALS['wp']->public_query_vars );
    269269        }
    270270
Note: See TracChangeset for help on using the changeset viewer.