Make WordPress Core


Ignore:
Timestamp:
09/04/2020 07:01:00 AM (4 years 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/customize/partial.php

    r48937 r48939  
    107107        $this->assertSame( $args['type'], $partial->type );
    108108        $this->assertSame( $args['selector'], $partial->selector );
    109         $this->assertEqualSets( $args['settings'], $partial->settings );
     109        $this->assertSameSets( $args['settings'], $partial->settings );
    110110        $this->assertSame( $args['primary_setting'], $partial->primary_setting );
    111111        $this->assertSame( $args['render_callback'], $partial->render_callback );
Note: See TracChangeset for help on using the changeset viewer.