Make WordPress Core


Ignore:
Timestamp:
10/07/2022 01:02:07 AM (4 years ago)
Author:
desrosj
Message:

Tests: Replace some occurrences of assertEquals() with assertSame().

This ensures that not only the return values match the expected results, but also that their type is the same.

Props costdev, desrosj.
See #55654.

File:
1 edited

Legend:

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

    r54088 r54402  
    901901                $assigned_terms = wp_get_object_terms( array( $post_id ), array( 'category' ), array() );
    902902                $this->assertCount( 1, $assigned_terms );
    903                 $this->assertEquals( $term_id, $assigned_terms[0]->term_id );
     903                $this->assertSame( $term_id, $assigned_terms[0]->term_id );
    904904
    905905                // Update the post with no changes.
     
    910910                $assigned_terms = wp_get_object_terms( array( $post_id ), array( 'category' ), array() );
    911911                $this->assertCount( 1, $assigned_terms );
    912                 $this->assertEquals( $term_id, $assigned_terms[0]->term_id );
     912                $this->assertSame( $term_id, $assigned_terms[0]->term_id );
    913913
    914914                // Remove the term from the post.
Note: See TracChangeset for help on using the changeset viewer.