Make WordPress Core


Ignore:
Timestamp:
07/10/2021 11:15:44 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( isset( ... ) ) with assertArrayHasKey() to use native PHPUnit functionality.

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

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/objects.php

    r51367 r51397  
    3636        $post = get_post( $id, ARRAY_N );
    3737        $this->assertIsArray( $post );
    38         $this->assertFalse( isset( $post['post_type'] ) );
     38        $this->assertArrayNotHasKey( 'post_type', $post );
    3939        $this->assertTrue( in_array( 'post', $post, true ) );
    4040
Note: See TracChangeset for help on using the changeset viewer.