Make WordPress Core


Ignore:
Timestamp:
06/10/2021 07:18:15 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSameSets() in some newly introduced tests.

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

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

Follow-up to [48939], [49925], [50157], [50959], [50960], [50995], [51079].

See #52625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r51079 r51137  
    6262        );
    6363
    64         $this->assertEqualSetsWithIndex( $expected, $actual );
     64        $this->assertSameSetsWithIndex( $expected, $actual );
    6565    }
    6666
     
    657657        $actual   = WP_Theme_JSON::get_from_editor_settings( array() );
    658658
    659         $this->assertEqualSetsWithIndex( $expected, $actual );
     659        $this->assertSameSetsWithIndex( $expected, $actual );
    660660    }
    661661
     
    674674        $actual = WP_Theme_JSON::get_from_editor_settings( $input );
    675675
    676         $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
     676        $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] );
    677677    }
    678678
     
    691691        $actual = WP_Theme_JSON::get_from_editor_settings( $input );
    692692
    693         $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
     693        $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] );
    694694    }
    695695
     
    708708        $actual = WP_Theme_JSON::get_from_editor_settings( $input );
    709709
    710         $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
     710        $this->assertSameSetsWithIndex( $expected, $actual['settings']['spacing'] );
    711711    }
    712712
Note: See TracChangeset for help on using the changeset viewer.