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/user/query.php

    r54090 r54402  
    5353                $users = new WP_User_Query();
    5454
    55                 $this->assertEquals( '', $users->get( 'fields' ) );
     55                $this->assertNull( $users->get( 'fields' ) );
    5656                if ( isset( $users->query_vars['fields'] ) ) {
    5757                        $this->assertSame( '', $users->query_vars['fields'] );
     
    583583                $query->prepare_query( array( 'fields' => 'all' ) );
    584584                $this->assertEmpty( $query->query_limit );
    585                 $this->assertEquals( '', $query->query_limit );
     585                $this->assertNull( $query->query_limit );
    586586                $_query_vars = $query->query_vars;
    587587
     
    16861686
    16871687                // Must include user that has the same string in display_name.
    1688                 $this->assertEquals( array( $new_user1 ), $ids );
     1688                $this->assertSameSetsWithIndex( array( (string) $new_user1 ), $ids );
    16891689        }
    16901690
Note: See TracChangeset for help on using the changeset viewer.