Make WordPress Core


Ignore:
Timestamp:
09/02/2020 12:35:36 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests.

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

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Props johnbillion, jrf, SergeyBiryukov.
See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/taxQuery.php

    r47122 r48937  
    9595        );
    9696
    97         $this->assertEquals( array( 'foo' ), $tq->queries[0]['terms'] );
     97        $this->assertSame( array( 'foo' ), $tq->queries[0]['terms'] );
    9898    }
    9999
     
    238238        $tq->transform_query( $tq->queries[0], 'term_id' );
    239239
    240         $this->assertEquals( array( $t1 ), $tq->queries[0]['terms'] );
     240        $this->assertSame( array( $t1 ), $tq->queries[0]['terms'] );
    241241        $this->assertSame( 'term_id', $tq->queries[0]['field'] );
    242242    }
Note: See TracChangeset for help on using the changeset viewer.