WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/07/2021 10:32:56 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertSame( [number], count( ... ) ) with assertCount() to use native PHPUnit functionality.

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

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php

    r51331 r51367  
    443443
    444444        // Verify that there is only a single value in the array and that a duplicate is not present.
    445         $this->assertSame( 1, count( get_post_meta( $post_id, 'enclosure' ) ) );
     445        $this->assertCount( 1, get_post_meta( $post_id, 'enclosure' ) );
    446446
    447447        // For good measure, check that the expected value is in the array.
     
    452452
    453453        // Having added the new enclosure, 2 values are expected in the array.
    454         $this->assertSame( 2, count( get_post_meta( $post_id, 'enclosure' ) ) );
     454        $this->assertCount( 2, get_post_meta( $post_id, 'enclosure' ) );
    455455
    456456        // Check that the new enclosure is in the enclosure meta.
Note: See TracChangeset for help on using the changeset viewer.