Make WordPress Core


Ignore:
Timestamp:
09/04/2020 07:01:00 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate.

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

These new methods replace most of the existing instances of assertEqualSets() and assertEqualSetsWithIndex().

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

Follow-up to [48937].

See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/DeletePlugin.php

    r47198 r48939  
    4242        );
    4343
    44         $this->assertEqualSets( $expected, $response );
     44        $this->assertSameSets( $expected, $response );
    4545    }
    4646
     
    6868        );
    6969
    70         $this->assertEqualSets( $expected, $response );
     70        $this->assertSameSets( $expected, $response );
    7171    }
    7272
     
    9595        );
    9696
    97         $this->assertEqualSets( $expected, $response );
     97        $this->assertSameSets( $expected, $response );
    9898    }
    9999
     
    124124        );
    125125
    126         $this->assertEqualSets( $expected, $response );
     126        $this->assertSameSets( $expected, $response );
    127127    }
    128128
     
    154154        );
    155155
    156         $this->assertEqualSets( $expected, $response );
     156        $this->assertSameSets( $expected, $response );
    157157    }
    158158}
Note: See TracChangeset for help on using the changeset viewer.