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/editor/wpEditors.php

    r43571 r48939  
    3333        $actual = _WP_Editors::wp_link_query( array( 's' => $post->post_title ) );
    3434
    35         $this->assertEqualSets(
     35        $this->assertSameSets(
    3636            array(
    3737                array(
     
    5454        remove_filter( 'wp_link_query', array( $this, 'wp_link_query_callback' ) );
    5555
    56         $this->assertEqualSets(
     56        $this->assertSameSets(
    5757            array(
    5858                array(
     
    7474        remove_filter( 'wp_link_query', array( $this, 'wp_link_query_callback' ) );
    7575
    76         $this->assertEqualSets(
     76        $this->assertSameSets(
    7777            array(
    7878                array(
Note: See TracChangeset for help on using the changeset viewer.