Make WordPress Core


Ignore:
Timestamp:
07/12/2021 10:35:44 AM (4 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/rest-request.php

    r51331 r51404  
    617617        $data = $valid->get_error_data( 'rest_missing_callback_param' );
    618618
    619         $this->assertTrue( in_array( 'someinteger', $data['params'], true ) );
    620         $this->assertTrue( in_array( 'someotherinteger', $data['params'], true ) );
     619        $this->assertContains( 'someinteger', $data['params'] );
     620        $this->assertContains( 'someotherinteger', $data['params'] );
    621621    }
    622622
Note: See TracChangeset for help on using the changeset viewer.