Make WordPress Core


Ignore:
Timestamp:
06/10/2021 07:18:15 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSameSets() in some newly introduced tests.

This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using assertSameSets() or assertSameSetsWithIndex() should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [49925], [50157], [50959], [50960], [50995], [51079].

See #52625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php

    r51135 r51137  
    403403            $data['preview']
    404404        );
    405         $this->assertEqualSets(
     405        $this->assertSameSets(
    406406            array(
    407407                'encoded' => base64_encode( serialize( array( 'title' => 'Test title' ) ) ),
     
    439439            $data['preview']
    440440        );
    441         $this->assertEqualSets(
     441        $this->assertSameSets(
    442442            array(
    443443                'encoded' => base64_encode( serialize( array( 'title' => 'Updated title' ) ) ),
     
    483483            $data['preview']
    484484        );
    485         $this->assertEqualSets(
     485        $this->assertSameSets(
    486486            array(
    487487                'encoded' => base64_encode( serialize( array( 'title' => 'Test title' ) ) ),
Note: See TracChangeset for help on using the changeset viewer.