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/l10n/localeSwitcher.php

    r46586 r48939  
    9292        restore_previous_locale();
    9393
    94         $this->assertEqualSetsWithIndex( $expected, $wp_locale_de_de->number_format );
     94        $this->assertSameSetsWithIndex( $expected, $wp_locale_de_de->number_format );
    9595    }
    9696
     
    197197        restore_previous_locale();
    198198
    199         $this->assertEqualSetsWithIndex( $expected, $wp_locale->number_format );
     199        $this->assertSameSetsWithIndex( $expected, $wp_locale->number_format );
    200200    }
    201201
Note: See TracChangeset for help on using the changeset viewer.