Make WordPress Core


Ignore:
Timestamp:
06/10/2021 07:18:15 PM (5 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/rest-api/rest-posts-controller.php

    r51026 r51137  
    11561156                $data     = $response->get_data();
    11571157
    1158                 $this->assertEqualSets( $post_ids, array_column( $data, 'id' ) );
     1158                $this->assertSameSets( $post_ids, array_column( $data, 'id' ) );
    11591159        }
    11601160
Note: See TracChangeset for help on using the changeset viewer.