Make WordPress Core


Ignore:
Timestamp:
07/12/2021 10:35:44 AM (3 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/post/meta.php

    r51331 r51404  
    9696        );
    9797        sort( $expected );
    98         $this->assertTrue( in_array( get_post_meta( self::$post_id, 'nonunique', true ), $expected, true ) );
     98        $this->assertContains( get_post_meta( self::$post_id, 'nonunique', true ), $expected );
    9999        $actual = get_post_meta( self::$post_id, 'nonunique', false );
    100100        sort( $actual );
Note: See TracChangeset for help on using the changeset viewer.