WordPress.org

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/multisite/networkQuery.php

    r48937 r48939  
    110110            );
    111111
    112             $this->assertEqualSets( $expected, $found );
     112            $this->assertSameSets( $expected, $found );
    113113        }
    114114
     
    124124            );
    125125
    126             $this->assertEqualSets( $expected, $found );
     126            $this->assertSameSets( $expected, $found );
    127127        }
    128128
     
    157157            );
    158158
    159             $this->assertEqualSets( $expected, $found );
     159            $this->assertSameSets( $expected, $found );
    160160        }
    161161
     
    175175            );
    176176
    177             $this->assertEqualSets( $expected, $found );
     177            $this->assertSameSets( $expected, $found );
    178178        }
    179179
     
    191191            );
    192192
    193             $this->assertEqualSets( $expected, $found );
     193            $this->assertSameSets( $expected, $found );
    194194        }
    195195
     
    207207            );
    208208
    209             $this->assertEqualSets( $expected, $found );
     209            $this->assertSameSets( $expected, $found );
    210210        }
    211211
     
    224224            );
    225225
    226             $this->assertEqualSets( $expected, $found );
     226            $this->assertSameSets( $expected, $found );
    227227        }
    228228
     
    241241            );
    242242
    243             $this->assertEqualSets( $expected, $found );
     243            $this->assertSameSets( $expected, $found );
    244244        }
    245245
     
    259259            );
    260260
    261             $this->assertEqualSets( $expected, $found );
     261            $this->assertSameSets( $expected, $found );
    262262        }
    263263
     
    278278            );
    279279
    280             $this->assertEqualSets( $expected, $found );
     280            $this->assertSameSets( $expected, $found );
    281281        }
    282282
     
    296296            );
    297297
    298             $this->assertEqualSets( $expected, $found );
     298            $this->assertSameSets( $expected, $found );
    299299        }
    300300
     
    314314            );
    315315
    316             $this->assertEqualSets( $expected, $found );
     316            $this->assertSameSets( $expected, $found );
    317317        }
    318318
     
    333333            );
    334334
    335             $this->assertEqualSets( $expected, $found );
     335            $this->assertSameSets( $expected, $found );
    336336        }
    337337
     
    352352            );
    353353
    354             $this->assertEqualSets( $expected, $found );
     354            $this->assertSameSets( $expected, $found );
    355355        }
    356356
     
    371371            );
    372372
    373             $this->assertEqualSets( $expected, $found );
     373            $this->assertSameSets( $expected, $found );
    374374        }
    375375
     
    399399            );
    400400
    401             $this->assertEqualSets( $expected, $found );
     401            $this->assertSameSets( $expected, $found );
    402402        }
    403403
     
    415415            );
    416416
    417             $this->assertEqualSets( $expected, $found );
     417            $this->assertSameSets( $expected, $found );
    418418        }
    419419
Note: See TracChangeset for help on using the changeset viewer.