Make WordPress Core


Ignore:
Timestamp:
07/11/2021 12:41:48 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( empty( ... ) ) with assertEmpty() to use native PHPUnit functionality.

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

See #53363.

File:
1 edited

Legend:

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

    r51367 r51403  
    261261
    262262        foreach ( $users as $user ) {
    263             $this->assertTrue( count_user_posts( $user['id'], $rest_post_types ) > 0 );
     263            $this->assertNotEmpty( count_user_posts( $user['id'], $rest_post_types ) );
    264264
    265265            // Ensure we don't expose non-public data.
Note: See TracChangeset for help on using the changeset viewer.