mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 03:34:33 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48939 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -220,7 +220,7 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
|
||||
if ( ! is_multisite() ) {
|
||||
$media_types[] = 'text';
|
||||
}
|
||||
$this->assertEqualSets( $media_types, $data['endpoints'][0]['args']['media_type']['enum'] );
|
||||
$this->assertSameSets( $media_types, $data['endpoints'][0]['args']['media_type']['enum'] );
|
||||
}
|
||||
|
||||
public function test_registered_get_item_params() {
|
||||
|
||||
Reference in New Issue
Block a user