From 8be943d06ebfd71e42daefac9bd630d6958e4db8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Sep 2020 07:01:00 +0000 Subject: [PATCH] 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 --- tests/phpunit/includes/abstract-testcase.php | 28 ++++ .../tests/admin/includesCommunityEvents.php | 4 +- .../phpunit/tests/admin/includesTemplate.php | 2 +- tests/phpunit/tests/admin/includesTheme.php | 24 +-- tests/phpunit/tests/ajax/DeletePlugin.php | 10 +- tests/phpunit/tests/ajax/ManageThemes.php | 14 +- tests/phpunit/tests/ajax/QuickEdit.php | 2 +- tests/phpunit/tests/ajax/UpdatePlugin.php | 20 +-- .../tests/blocks/block-type-registry.php | 2 +- tests/phpunit/tests/blocks/block-type.php | 6 +- tests/phpunit/tests/blocks/register.php | 6 +- tests/phpunit/tests/bookmark/getBookmarks.php | 2 +- tests/phpunit/tests/comment/query.php | 154 +++++++++--------- .../tests/customize/custom-css-setting.php | 4 +- tests/phpunit/tests/customize/manager.php | 14 +- .../tests/customize/nav-menu-item-setting.php | 2 +- .../tests/customize/nav-menu-setting.php | 12 +- tests/phpunit/tests/customize/nav-menus.php | 4 +- tests/phpunit/tests/customize/partial.php | 2 +- .../customize/selective-refresh-ajax.php | 6 +- .../tests/customize/selective-refresh.php | 4 +- tests/phpunit/tests/customize/widgets.php | 2 +- tests/phpunit/tests/db.php | 2 +- tests/phpunit/tests/dependencies/jquery.php | 2 +- tests/phpunit/tests/dependencies/scripts.php | 40 ++--- tests/phpunit/tests/editor/wpEditors.php | 6 +- .../tests/functions/allowedProtocols.php | 2 +- tests/phpunit/tests/functions/wpListUtil.php | 10 +- tests/phpunit/tests/general/wpError.php | 38 ++--- tests/phpunit/tests/hooks/iterator.php | 4 +- tests/phpunit/tests/includes/helpers.php | 22 +-- tests/phpunit/tests/l10n.php | 2 +- tests/phpunit/tests/l10n/localeSwitcher.php | 4 +- tests/phpunit/tests/menu/nav-menu.php | 6 +- tests/phpunit/tests/meta/deleteMetadata.php | 24 +-- tests/phpunit/tests/meta/query.php | 4 +- .../tests/multisite/getBlogDetails.php | 4 +- .../phpunit/tests/multisite/networkQuery.php | 34 ++-- tests/phpunit/tests/multisite/site.php | 12 +- tests/phpunit/tests/multisite/siteMeta.php | 16 +- tests/phpunit/tests/multisite/siteQuery.php | 62 +++---- .../tests/multisite/wpMSSitesListTable.php | 12 +- tests/phpunit/tests/oembed/WpEmbed.php | 6 +- .../phpunit/tests/oembed/getResponseData.php | 6 +- tests/phpunit/tests/post.php | 6 +- tests/phpunit/tests/post/getPageChildren.php | 2 +- tests/phpunit/tests/post/getPages.php | 42 ++--- tests/phpunit/tests/post/nav-menu.php | 20 +-- tests/phpunit/tests/post/query.php | 4 +- tests/phpunit/tests/post/types.php | 6 +- tests/phpunit/tests/post/wpPostType.php | 16 +- tests/phpunit/tests/query.php | 18 +- tests/phpunit/tests/query/commentCount.php | 30 ++-- tests/phpunit/tests/query/dateQuery.php | 32 ++-- tests/phpunit/tests/query/metaQuery.php | 140 ++++++++-------- tests/phpunit/tests/query/postStatus.php | 10 +- tests/phpunit/tests/query/search.php | 16 +- tests/phpunit/tests/query/taxQuery.php | 22 +-- .../rest-api/rest-attachments-controller.php | 2 +- .../rest-api/rest-autosaves-controller.php | 8 +- .../rest-block-renderer-controller.php | 4 +- .../rest-api/rest-block-type-controller.php | 32 ++-- .../rest-api/rest-categories-controller.php | 6 +- .../rest-api/rest-comments-controller.php | 2 +- .../tests/rest-api/rest-controller.php | 2 +- .../tests/rest-api/rest-pages-controller.php | 6 +- .../rest-post-statuses-controller.php | 8 +- .../rest-api/rest-post-types-controller.php | 4 +- .../tests/rest-api/rest-posts-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-request.php | 2 +- .../rest-api/rest-revisions-controller.php | 8 +- .../tests/rest-api/rest-search-controller.php | 22 +-- tests/phpunit/tests/rest-api/rest-server.php | 2 +- .../tests/rest-api/rest-tags-controller.php | 8 +- .../rest-api/rest-taxonomies-controller.php | 4 +- .../tests/rest-api/rest-themes-controller.php | 2 +- .../tests/rest-api/rest-users-controller.php | 2 +- tests/phpunit/tests/rewrite/permastructs.php | 2 +- tests/phpunit/tests/rewrite/rewriteTags.php | 42 ++--- .../phpunit/tests/sitemaps/sitemaps-users.php | 2 +- tests/phpunit/tests/sitemaps/sitemaps.php | 2 +- tests/phpunit/tests/taxonomy.php | 14 +- tests/phpunit/tests/term/cache.php | 2 +- tests/phpunit/tests/term/getTerms.php | 132 +++++++-------- tests/phpunit/tests/term/getTheTerms.php | 6 +- tests/phpunit/tests/term/meta.php | 16 +- tests/phpunit/tests/term/query.php | 20 +-- tests/phpunit/tests/term/splitSharedTerm.php | 2 +- .../term/wpDeleteObjectTermRelationships.php | 8 +- tests/phpunit/tests/term/wpGetObjectTerms.php | 10 +- tests/phpunit/tests/term/wpSetObjectTerms.php | 12 +- tests/phpunit/tests/theme.php | 10 +- tests/phpunit/tests/theme/WPTheme.php | 8 +- tests/phpunit/tests/user.php | 2 +- tests/phpunit/tests/user/countUsers.php | 4 +- tests/phpunit/tests/user/dateQuery.php | 4 +- tests/phpunit/tests/user/query.php | 20 +-- tests/phpunit/tests/widgets.php | 4 +- .../tests/widgets/media-audio-widget.php | 4 +- .../tests/widgets/media-gallery-widget.php | 2 +- .../tests/widgets/media-image-widget.php | 4 +- .../tests/widgets/media-video-widget.php | 4 +- tests/phpunit/tests/widgets/media-widget.php | 12 +- tests/phpunit/tests/xmlrpc/wp/getProfile.php | 2 +- tests/phpunit/tests/xmlrpc/wp/getUser.php | 4 +- 105 files changed, 757 insertions(+), 729 deletions(-) diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 6825192c9d..94c7aaf634 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -684,6 +684,20 @@ abstract class WP_UnitTestCase_Base extends PHPUnit\Framework\TestCase { $this->assertSameIgnoreEOL( $expected, $actual ); } + /** + * Asserts that the contents of two un-keyed, single arrays are the same, without accounting for the order of elements. + * + * @since 5.6.0 + * + * @param array $expected Expected array. + * @param array $actual Array to check. + */ + public function assertSameSets( $expected, $actual ) { + sort( $expected ); + sort( $actual ); + $this->assertSame( $expected, $actual ); + } + /** * Asserts that the contents of two un-keyed, single arrays are equal, without accounting for the order of elements. * @@ -698,6 +712,20 @@ abstract class WP_UnitTestCase_Base extends PHPUnit\Framework\TestCase { $this->assertEquals( $expected, $actual ); } + /** + * Asserts that the contents of two keyed, single arrays are the same, without accounting for the order of elements. + * + * @since 5.6.0 + * + * @param array $expected Expected array. + * @param array $actual Array to check. + */ + public function assertSameSetsWithIndex( $expected, $actual ) { + ksort( $expected ); + ksort( $actual ); + $this->assertSame( $expected, $actual ); + } + /** * Asserts that the contents of two keyed, single arrays are equal, without accounting for the order of elements. * diff --git a/tests/phpunit/tests/admin/includesCommunityEvents.php b/tests/phpunit/tests/admin/includesCommunityEvents.php index 4dec1dbf27..5bae0d8b5d 100644 --- a/tests/phpunit/tests/admin/includesCommunityEvents.php +++ b/tests/phpunit/tests/admin/includesCommunityEvents.php @@ -163,7 +163,7 @@ class Test_WP_Community_Events extends WP_UnitTestCase { $response = $this->instance->get_events(); $this->assertNotWPError( $response ); - $this->assertEqualSetsWithIndex( $this->get_user_location(), $response['location'] ); + $this->assertSameSetsWithIndex( $this->get_user_location(), $response['location'] ); $this->assertSame( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $response['events'][0]['formatted_date'] ); $this->assertSame( '1:00 pm', $response['events'][0]['formatted_time'] ); @@ -184,7 +184,7 @@ class Test_WP_Community_Events extends WP_UnitTestCase { $cached_events = $this->instance->get_cached_events(); $this->assertNotWPError( $cached_events ); - $this->assertEqualSetsWithIndex( $this->get_user_location(), $cached_events['location'] ); + $this->assertSameSetsWithIndex( $this->get_user_location(), $cached_events['location'] ); $this->assertSame( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $cached_events['events'][0]['formatted_date'] ); $this->assertSame( '1:00 pm', $cached_events['events'][0]['formatted_time'] ); diff --git a/tests/phpunit/tests/admin/includesTemplate.php b/tests/phpunit/tests/admin/includesTemplate.php index 4768bcb764..80a74eb4ef 100644 --- a/tests/phpunit/tests/admin/includesTemplate.php +++ b/tests/phpunit/tests/admin/includesTemplate.php @@ -161,7 +161,7 @@ class Tests_Admin_includesTemplate extends WP_UnitTestCase { set_transient( 'settings_errors', array( $blogname_error ) ); $wp_settings_errors = null; add_settings_error( $blogdescription_error['setting'], $blogdescription_error['code'], $blogdescription_error['message'], $blogdescription_error['type'] ); - $this->assertEqualSets( array( $blogname_error, $blogdescription_error ), get_settings_errors() ); + $this->assertSameSets( array( $blogname_error, $blogdescription_error ), get_settings_errors() ); $wp_settings_errors = null; } diff --git a/tests/phpunit/tests/admin/includesTheme.php b/tests/phpunit/tests/admin/includesTheme.php index 20a3e278b6..ca842df921 100644 --- a/tests/phpunit/tests/admin/includesTheme.php +++ b/tests/phpunit/tests/admin/includesTheme.php @@ -48,7 +48,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { switch_theme( $theme['Template'], $theme['Stylesheet'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level.php', 'Sub Dir' => 'subdir/template-sub-dir.php', @@ -62,7 +62,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { switch_theme( $theme['Template'], $theme['Stylesheet'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level.php', 'Sub Dir' => 'subdir/template-sub-dir.php', @@ -81,14 +81,14 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { switch_theme( $theme['Template'], $theme['Stylesheet'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level-post-types.php', 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', ), get_page_templates( null, 'foo' ) ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level-post-types.php', 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', @@ -107,7 +107,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { switch_theme( $theme['Template'], $theme['Stylesheet'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'No Trailing Period' => '38766/no-trailing-period-post-types.php', 'Trailing Period.' => '38766/trailing-period-post-types.php', @@ -118,7 +118,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { ), get_page_templates( null, 'period' ) ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'No Trailing Period' => '38766/no-trailing-period-post-types.php', 'Trailing Period.' => '38766/trailing-period-post-types.php', @@ -139,7 +139,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { switch_theme( $theme['Template'], $theme['Stylesheet'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level-post-types.php', 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', @@ -149,7 +149,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { get_page_templates( null, 'foo' ) ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level-post-types.php', 'Sub Dir' => 'subdir/template-sub-dir-post-types.php', @@ -157,7 +157,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { get_page_templates( null, 'post' ) ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'Top Level' => 'template-top-level.php', 'Sub Dir' => 'subdir/template-sub-dir.php', @@ -180,7 +180,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { $post_templates = $theme->get_post_templates(); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'template-top-level-post-types.php' => 'Top Level', 'subdir/template-sub-dir-post-types.php' => 'Sub Dir', @@ -190,7 +190,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { $post_templates['foo'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'template-top-level-post-types.php' => 'Top Level', 'subdir/template-sub-dir-post-types.php' => 'Sub Dir', @@ -198,7 +198,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase { $post_templates['post'] ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'template-top-level.php' => 'Top Level', 'subdir/template-sub-dir.php' => 'Sub Dir', diff --git a/tests/phpunit/tests/ajax/DeletePlugin.php b/tests/phpunit/tests/ajax/DeletePlugin.php index c932542a5c..871e859a8f 100644 --- a/tests/phpunit/tests/ajax/DeletePlugin.php +++ b/tests/phpunit/tests/ajax/DeletePlugin.php @@ -41,7 +41,7 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_missing_slug() { @@ -67,7 +67,7 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_missing_capability() { @@ -94,7 +94,7 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_invalid_file() { @@ -123,7 +123,7 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_delete_plugin() { @@ -153,6 +153,6 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } } diff --git a/tests/phpunit/tests/ajax/ManageThemes.php b/tests/phpunit/tests/ajax/ManageThemes.php index 31e9b0a7d6..024dd1b6e8 100644 --- a/tests/phpunit/tests/ajax/ManageThemes.php +++ b/tests/phpunit/tests/ajax/ManageThemes.php @@ -70,7 +70,7 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_missing_capability() { @@ -92,13 +92,13 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase { 'data' => array( 'update' => 'theme', 'slug' => 'foo', - 'errorMessage' => 'Sorry, you are not allowed to update themes for this site.', 'oldVersion' => '', 'newVersion' => '', + 'errorMessage' => 'Sorry, you are not allowed to update themes for this site.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_update_theme() { @@ -128,14 +128,14 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase { 'data' => array( 'update' => 'theme', 'slug' => 'twentyten', - 'errorMessage' => 'The theme is at the latest version.', 'oldVersion' => $theme->get( 'Version' ), 'newVersion' => '', 'debug' => array( 'The theme is at the latest version.' ), + 'errorMessage' => 'The theme is at the latest version.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } function test_uppercase_theme_slug() { @@ -161,11 +161,11 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase { 'slug' => 'camelCase', 'oldVersion' => '1.0', 'newVersion' => '', - 'errorMessage' => 'The theme is at the latest version.', 'debug' => array( 'The theme is at the latest version.' ), + 'errorMessage' => 'The theme is at the latest version.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } } diff --git a/tests/phpunit/tests/ajax/QuickEdit.php b/tests/phpunit/tests/ajax/QuickEdit.php index aa10ac883f..2369930cfb 100644 --- a/tests/phpunit/tests/ajax/QuickEdit.php +++ b/tests/phpunit/tests/ajax/QuickEdit.php @@ -81,6 +81,6 @@ class Tests_Ajax_QuickEdit extends WP_Ajax_UnitTestCase { // 'wptests_tax_2' terms should have been added successfully. $post_terms_2 = wp_get_object_terms( $post->ID, 'wptests_tax_2' ); - $this->assertEqualSets( array( $t2 ), wp_list_pluck( $post_terms_2, 'term_id' ) ); + $this->assertSameSets( array( $t2 ), wp_list_pluck( $post_terms_2, 'term_id' ) ); } } diff --git a/tests/phpunit/tests/ajax/UpdatePlugin.php b/tests/phpunit/tests/ajax/UpdatePlugin.php index ffc027123e..81649da032 100644 --- a/tests/phpunit/tests/ajax/UpdatePlugin.php +++ b/tests/phpunit/tests/ajax/UpdatePlugin.php @@ -41,7 +41,7 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_missing_slug() { @@ -67,7 +67,7 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_missing_capability() { @@ -90,13 +90,13 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { 'data' => array( 'update' => 'plugin', 'slug' => 'foo', - 'errorMessage' => 'Sorry, you are not allowed to update plugins for this site.', 'oldVersion' => '', 'newVersion' => '', + 'errorMessage' => 'Sorry, you are not allowed to update plugins for this site.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_invalid_file() { @@ -121,13 +121,13 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { 'data' => array( 'update' => 'plugin', 'slug' => 'foo', - 'errorMessage' => 'Sorry, you are not allowed to update plugins for this site.', 'oldVersion' => '', 'newVersion' => '', + 'errorMessage' => 'Sorry, you are not allowed to update plugins for this site.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } public function test_update_plugin() { @@ -155,15 +155,15 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { 'data' => array( 'update' => 'plugin', 'slug' => 'hello-dolly', - 'plugin' => 'hello.php', - 'pluginName' => 'Hello Dolly', - 'errorMessage' => 'The plugin is at the latest version.', 'oldVersion' => 'Version 1.7.2', 'newVersion' => '', + 'plugin' => 'hello.php', + 'pluginName' => 'Hello Dolly', 'debug' => array( 'The plugin is at the latest version.' ), + 'errorMessage' => 'The plugin is at the latest version.', ), ); - $this->assertEqualSets( $expected, $response ); + $this->assertSameSets( $expected, $response ); } } diff --git a/tests/phpunit/tests/blocks/block-type-registry.php b/tests/phpunit/tests/blocks/block-type-registry.php index 190fcebdf7..78c2a5e699 100644 --- a/tests/phpunit/tests/blocks/block-type-registry.php +++ b/tests/phpunit/tests/blocks/block-type-registry.php @@ -186,6 +186,6 @@ class WP_Test_Block_Type_Registry extends WP_UnitTestCase { } $registered = $this->registry->get_all_registered(); - $this->assertEqualSets( $names, array_keys( $registered ) ); + $this->assertSameSets( $names, array_keys( $registered ) ); } } diff --git a/tests/phpunit/tests/blocks/block-type.php b/tests/phpunit/tests/blocks/block-type.php index d4457ab054..e93aed05a2 100644 --- a/tests/phpunit/tests/blocks/block-type.php +++ b/tests/phpunit/tests/blocks/block-type.php @@ -369,12 +369,12 @@ class WP_Test_Block_Type extends WP_UnitTestCase { $this->assertSame( 'Test title', $block_type->title ); $this->assertSame( 'Test category', $block_type->category ); - $this->assertEqualSets( array( 'core/third-party' ), $block_type->parent ); + $this->assertSameSets( array( 'core/third-party' ), $block_type->parent ); $this->assertSame( 'icon.png', $block_type->icon ); $this->assertSame( 'test description', $block_type->description ); - $this->assertEqualSets( array( 'test keyword' ), $block_type->keywords ); + $this->assertSameSets( array( 'test keyword' ), $block_type->keywords ); $this->assertSame( 'test_domain', $block_type->textdomain ); - $this->assertEqualSets( array( 'alignment' => true ), $block_type->supports ); + $this->assertSameSets( array( 'alignment' => true ), $block_type->supports ); } /** diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php index 49480d08f2..6a872c0455 100644 --- a/tests/phpunit/tests/blocks/register.php +++ b/tests/phpunit/tests/blocks/register.php @@ -288,10 +288,10 @@ class WP_Test_Block_Register extends WP_UnitTestCase { $this->assertSame( 'my-plugin/notice', $result->name ); $this->assertSame( 'Notice', $result->title ); $this->assertSame( 'common', $result->category ); - $this->assertEqualSets( array( 'core/group' ), $result->parent ); + $this->assertSameSets( array( 'core/group' ), $result->parent ); $this->assertSame( 'star', $result->icon ); $this->assertSame( 'Shows warning, error or success notices…', $result->description ); - $this->assertEqualSets( array( 'alert', 'message' ), $result->keywords ); + $this->assertSameSets( array( 'alert', 'message' ), $result->keywords ); $this->assertSame( array( 'message' => array( @@ -308,7 +308,7 @@ class WP_Test_Block_Register extends WP_UnitTestCase { ), $result->provides_context ); - $this->assertEqualSets( array( 'groupId' ), $result->uses_context ); + $this->assertSameSets( array( 'groupId' ), $result->uses_context ); $this->assertSame( array( 'align' => true, diff --git a/tests/phpunit/tests/bookmark/getBookmarks.php b/tests/phpunit/tests/bookmark/getBookmarks.php index 962d799a39..9200ed9d09 100644 --- a/tests/phpunit/tests/bookmark/getBookmarks.php +++ b/tests/phpunit/tests/bookmark/getBookmarks.php @@ -23,7 +23,7 @@ class Tests_Bookmark_GetBookmarks extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $found1, $found2 ); + $this->assertSameSets( $found1, $found2 ); $this->assertSame( $num_queries, $wpdb->num_queries ); } diff --git a/tests/phpunit/tests/comment/query.php b/tests/phpunit/tests/comment/query.php index 3272c17774..a8b856d5d8 100644 --- a/tests/phpunit/tests/comment/query.php +++ b/tests/phpunit/tests/comment/query.php @@ -60,7 +60,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); } public function test_query_post_id_0() { @@ -79,7 +79,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1 ), $found ); + $this->assertSameSets( array( $c1 ), $found ); } /** @@ -129,7 +129,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); } /** @@ -179,7 +179,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1 ), $found ); + $this->assertSameSets( array( $c1 ), $found ); } public function test_query_type_pingback() { @@ -219,7 +219,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2, $c3 ), $found ); + $this->assertSameSets( array( $c2, $c3 ), $found ); } @@ -260,7 +260,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2, $c3 ), $found ); + $this->assertSameSets( array( $c2, $c3 ), $found ); } @@ -311,7 +311,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2, $c3 ), $found ); + $this->assertSameSets( array( $c2, $c3 ), $found ); } /** @@ -370,7 +370,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c4, $c6 ), $found ); + $this->assertSameSets( array( $c1, $c4, $c6 ), $found ); } /** @@ -427,7 +427,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); } /** @@ -485,7 +485,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1 ), $found ); + $this->assertSameSets( array( $c1 ), $found ); } /** @@ -543,7 +543,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2, $c3 ), $found ); + $this->assertSameSets( array( $c2, $c3 ), $found ); } /** @@ -600,7 +600,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); } /** @@ -650,7 +650,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); } /** @@ -686,7 +686,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); } /** @@ -794,7 +794,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2, $c3 ), $found ); + $this->assertSameSets( array( $c2, $c3 ), $found ); } /** @@ -838,7 +838,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3, $c2 ), $found ); + $this->assertSameSets( array( $c3, $c2 ), $found ); } /** @@ -954,7 +954,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3, $c2 ), $found ); + $this->assertSameSets( array( $c3, $c2 ), $found ); } /** @@ -988,7 +988,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $found ); + $this->assertSameSets( array( $c1, $c2 ), $found ); } /** @@ -1106,7 +1106,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c3 ), $found ); } public function test_status_default_to_all() { @@ -1136,7 +1136,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c3 ), $found ); } /** @@ -1170,7 +1170,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); } /** @@ -1204,7 +1204,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $found ); + $this->assertSameSets( array( $c1, $c2 ), $found ); } /** @@ -1238,7 +1238,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $found ); + $this->assertSameSets( array( $c1, $c2 ), $found ); } /** @@ -1687,7 +1687,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $comments ); + $this->assertSameSets( array( $c1, $c2 ), $comments ); } /** @@ -1723,7 +1723,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $comment_ids = get_comments( array( 'fields' => 'ids' ) ); $this->assertCount( 3, $comment_ids ); - $this->assertEqualSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); + $this->assertSameSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); } /** @@ -1759,7 +1759,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $comment_1, $comment_3 ), $comment_ids ); + $this->assertSameSets( array( $comment_1, $comment_3 ), $comment_ids ); } /** @@ -1795,7 +1795,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $comment_1 ), $comment_ids ); + $this->assertSameSets( array( $comment_1 ), $comment_ids ); } /** @@ -1835,7 +1835,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $comment_ids ); + $this->assertSameSets( array( $c1, $c2 ), $comment_ids ); } /** @@ -1875,7 +1875,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3 ), $comment_ids ); + $this->assertSameSets( array( $c3 ), $comment_ids ); } /** @@ -1918,7 +1918,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $comment_ids ); + $this->assertSameSets( array( $c1, $c2 ), $comment_ids ); } /** @@ -1961,7 +1961,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3 ), $comment_ids ); + $this->assertSameSets( array( $c3 ), $comment_ids ); } /** @@ -2009,7 +2009,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c3 ), $comment_ids ); + $this->assertSameSets( array( $c1, $c3 ), $comment_ids ); } /** @@ -2057,7 +2057,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3, $c4 ), $comment_ids ); + $this->assertSameSets( array( $c3, $c4 ), $comment_ids ); } /** @@ -2088,7 +2088,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $comments_approved_1 = get_comments( array( 'status' => 'all' ) ); $comment_ids = get_comments( array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); + $this->assertSameSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); } /** @@ -2132,7 +2132,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); } /** @@ -2183,7 +2183,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); } /** @@ -2234,7 +2234,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); } /** @@ -2284,7 +2284,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); } /** @@ -2343,7 +2343,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); } /** @@ -2402,7 +2402,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); } public function test_search() { @@ -2475,7 +2475,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); + $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); } /** @@ -3055,7 +3055,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); _unregister_post_type( 'post-type-1' ); _unregister_post_type( 'post-type-2' ); @@ -3082,7 +3082,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); _unregister_post_type( 'post-type-1' ); _unregister_post_type( 'post-type-2' ); @@ -3112,7 +3112,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c3 ), $found ); + $this->assertSameSets( array_merge( $c1, $c3 ), $found ); } public function test_post_name_single_value() { @@ -3130,7 +3130,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); } /** @@ -3151,7 +3151,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); } /** @@ -3174,7 +3174,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c3 ), $found ); + $this->assertSameSets( array_merge( $c1, $c3 ), $found ); } public function test_post_status_single_value() { @@ -3192,7 +3192,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); } /** @@ -3213,7 +3213,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c2, $found ); + $this->assertSameSets( $c2, $found ); } /** @@ -3236,7 +3236,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c3 ), $found ); + $this->assertSameSets( array_merge( $c1, $c3 ), $found ); } /** @@ -3259,7 +3259,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { 'post_type' => array( 'any', 'post-type-1' ), ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $found ); + $this->assertSameSets( array_merge( $c1, $c2 ), $found ); } /** @@ -3282,7 +3282,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { 'post_type' => array( 'any' ), ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $found ); + $this->assertSameSets( array_merge( $c1, $c2 ), $found ); } /** @@ -3302,7 +3302,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { 'post_status' => array( 'any', 'draft' ), ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $found ); + $this->assertSameSets( array_merge( $c1, $c2 ), $found ); } /** @@ -3322,7 +3322,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { 'post_status' => array( 'any' ), ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $found ); + $this->assertSameSets( array_merge( $c1, $c2 ), $found ); } /** @@ -3446,7 +3446,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { remove_action( 'pre_get_comments', array( $this, 'modify_meta_query' ) ); - $this->assertEqualSets( array( $comments[1] ), $q->comments ); + $this->assertSameSets( array( $comments[1] ), $q->comments ); } public function modify_meta_query( $q ) { @@ -3484,7 +3484,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { remove_action( 'pre_get_comments', array( $this, 'modify_meta_params' ) ); - $this->assertEqualSets( array( $comments[1] ), $q->comments ); + $this->assertSameSets( array( $comments[1] ), $q->comments ); } public function modify_meta_params( $q ) { @@ -3518,7 +3518,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c2 ), $ids->comments ); + $this->assertSameSets( array( $c2 ), $ids->comments ); } /** @@ -3560,7 +3560,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c3, $c4 ), $ids->comments ); + $this->assertSameSets( array( $c3, $c4 ), $ids->comments ); } /** @@ -3590,7 +3590,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1 ), $ids->comments ); + $this->assertSameSets( array( $c1 ), $ids->comments ); } /** @@ -3633,7 +3633,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2 ), $ids->comments ); + $this->assertSameSets( array( $c1, $c2 ), $ids->comments ); } /** @@ -4161,7 +4161,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ); $q2_ids = wp_list_pluck( $q2->comments, 'comment_ID' ); - $this->assertEqualSets( $q1_ids, $q2_ids ); + $this->assertSameSets( $q1_ids, $q2_ids ); $this->assertSame( $num_queries, $wpdb->num_queries ); } @@ -4223,7 +4223,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); $q2_ids = wp_list_pluck( $q2->comments, 'comment_ID' ); - $this->assertEqualSets( $q1_ids, $q2_ids ); + $this->assertSameSets( $q1_ids, $q2_ids ); } /** @@ -4287,11 +4287,11 @@ class Tests_Comment_Query extends WP_UnitTestCase { $found_1 = $found[ $c1 ]; $children_1 = $found_1->get_children(); - $this->assertEqualSets( array( $c2 ), array_keys( $children_1 ) ); + $this->assertSameSets( array( $c2 ), array_keys( $children_1 ) ); $found_3 = $found[ $c3 ]; $children_3 = $found_3->get_children(); - $this->assertEqualSets( array( $c4, $c5 ), array_keys( $children_3 ) ); + $this->assertSameSets( array( $c4, $c5 ), array_keys( $children_3 ) ); } /** @@ -4441,7 +4441,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ); $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array( $c ), $q->comments ); + $this->assertSameSets( array( $c ), $q->comments ); } public function test_updated_comment_should_invalidate_query_cache() { @@ -4481,7 +4481,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array( $c ), $q->comments ); + $this->assertSameSets( array( $c ), $q->comments ); } public function test_deleted_comment_should_invalidate_query_cache() { @@ -4514,7 +4514,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array(), $q->comments ); + $this->assertSameSets( array(), $q->comments ); } public function test_trashed_comment_should_invalidate_query_cache() { @@ -4547,7 +4547,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array(), $q->comments ); + $this->assertSameSets( array(), $q->comments ); } public function test_untrashed_comment_should_invalidate_query_cache() { @@ -4582,7 +4582,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array( $c ), $q->comments ); + $this->assertSameSets( array( $c ), $q->comments ); } public function test_spammed_comment_should_invalidate_query_cache() { @@ -4615,7 +4615,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array(), $q->comments ); + $this->assertSameSets( array(), $q->comments ); } public function test_unspammed_comment_should_invalidate_query_cache() { @@ -4650,7 +4650,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); - $this->assertEqualSets( array( $c ), $q->comments ); + $this->assertSameSets( array( $c ), $q->comments ); } /** @@ -4766,7 +4766,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c1, $cached ); + $this->assertSameSets( $c1, $cached ); foreach ( $c2 as $cid ) { add_comment_meta( $cid, 'sauce', 'fire' ); @@ -4785,7 +4785,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $found ); + $this->assertSameSets( array_merge( $c1, $c2 ), $found ); } /** @@ -4815,7 +4815,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $cached ); + $this->assertSameSets( array_merge( $c1, $c2 ), $cached ); foreach ( $c2 as $cid ) { update_comment_meta( $cid, 'sauce', 'foo' ); @@ -4834,7 +4834,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c1, $found ); + $this->assertSameSets( $c1, $found ); } /** @@ -4864,7 +4864,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array_merge( $c1, $c2 ), $cached ); + $this->assertSameSets( array_merge( $c1, $c2 ), $cached ); foreach ( $c2 as $cid ) { delete_comment_meta( $cid, 'sauce' ); @@ -4883,7 +4883,7 @@ class Tests_Comment_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $c1, $found ); + $this->assertSameSets( $c1, $found ); } /** diff --git a/tests/phpunit/tests/customize/custom-css-setting.php b/tests/phpunit/tests/customize/custom-css-setting.php index a1b1950562..9c246c63ea 100644 --- a/tests/phpunit/tests/customize/custom-css-setting.php +++ b/tests/phpunit/tests/customize/custom-css-setting.php @@ -345,10 +345,10 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { */ function filter_update_custom_css_data( $data, $args ) { $this->assertInternalType( 'array', $data ); - $this->assertEqualSets( array( 'css', 'preprocessed' ), array_keys( $data ) ); + $this->assertSameSets( array( 'css', 'preprocessed' ), array_keys( $data ) ); $this->assertSame( '', $data['preprocessed'] ); $this->assertInternalType( 'array', $args ); - $this->assertEqualSets( array( 'css', 'preprocessed', 'stylesheet' ), array_keys( $args ) ); + $this->assertSameSets( array( 'css', 'preprocessed', 'stylesheet' ), array_keys( $args ) ); $this->assertSame( $args['css'], $data['css'] ); $this->assertSame( $args['preprocessed'], $data['preprocessed'] ); diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php index 00aad6987a..89ef378436 100644 --- a/tests/phpunit/tests/customize/manager.php +++ b/tests/phpunit/tests/customize/manager.php @@ -674,7 +674,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { 'page_on_front', 'page_for_posts', ); - $this->assertEqualSets( $expected_setting_ids, array_keys( $changeset_values ) ); + $this->assertSameSets( $expected_setting_ids, array_keys( $changeset_values ) ); foreach ( array( 'widget_text[2]', 'widget_meta[3]' ) as $setting_id ) { $this->assertInternalType( 'array', $changeset_values[ $setting_id ] ); @@ -742,7 +742,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { $wp_customize->import_theme_starter_content(); $changeset_data = $wp_customize->changeset_data(); // Auto-drafts should not get re-created and amended with each import. - $this->assertEqualSets( array_values( $posts_by_name ), $changeset_data['nav_menus_created_posts']['value'] ); + $this->assertSameSets( array_values( $posts_by_name ), $changeset_data['nav_menus_created_posts']['value'] ); // Test that saving non-starter content on top of the changeset clears the starter_content flag. $wp_customize->save_changeset_post( @@ -870,7 +870,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { 'nested_array_option', 'nested_array_theme_mod', ); - $this->assertEqualSets( $expected_setting_ids, array_keys( $changeset_values ) ); + $this->assertSameSets( $expected_setting_ids, array_keys( $changeset_values ) ); $this->assertSame( $existing_published_home_page_id, $changeset_values['array_option']['home_page_id'] ); $this->assertSame( $existing_published_home_page_id, $changeset_values['nested_array_option'][2]['home_page_id'] ); @@ -1611,7 +1611,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { $setting_id = preg_replace( '/^.+::/', '', $setting_id ); $this->assertSame( $save_counts[ $setting_id ] + 1, did_action( sprintf( 'customize_save_%s', $setting_id ) ), $setting_id ); } - $this->assertEqualSets( array( 'blogname', 'blogdescription', 'background_color', 'scratchpad' ), array_keys( $this->filtered_setting_current_user_ids ) ); + $this->assertSameSets( array( 'blogname', 'blogdescription', 'background_color', 'scratchpad' ), array_keys( $this->filtered_setting_current_user_ids ) ); $this->assertSame( $other_admin_user_id, $this->filtered_setting_current_user_ids['blogname'] ); $this->assertSame( 0, $this->filtered_setting_current_user_ids['blogdescription'] ); $this->assertSame( self::$subscriber_user_id, $this->filtered_setting_current_user_ids['scratchpad'] ); @@ -2221,7 +2221,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { add_filter( 'customize_allowed_urls', array( $this, 'filter_customize_allowed_urls' ) ); $allowed = $wp_customize->get_allowed_urls(); - $this->assertEqualSets( $allowed, array( 'http://headless.example.com/', home_url( '/', 'http' ) ) ); + $this->assertSameSets( $allowed, array( 'http://headless.example.com/', home_url( '/', 'http' ) ) ); } /** @@ -3089,12 +3089,12 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { $data = json_decode( $json, true ); $this->assertNotEmpty( $data ); - $this->assertEqualSets( array( 'theme', 'url', 'browser', 'panels', 'sections', 'nonce', 'autofocus', 'documentTitleTmpl', 'previewableDevices', 'changeset', 'timeouts', 'dateFormat', 'timeFormat', 'initialClientTimestamp', 'initialServerDate', 'initialServerTimestamp', 'l10n' ), array_keys( $data ) ); + $this->assertSameSets( array( 'theme', 'url', 'browser', 'panels', 'sections', 'nonce', 'autofocus', 'documentTitleTmpl', 'previewableDevices', 'changeset', 'timeouts', 'dateFormat', 'timeFormat', 'initialClientTimestamp', 'initialServerDate', 'initialServerTimestamp', 'l10n' ), array_keys( $data ) ); $this->assertSame( $autofocus, $data['autofocus'] ); $this->assertArrayHasKey( 'save', $data['nonce'] ); $this->assertArrayHasKey( 'preview', $data['nonce'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'branching', 'autosaved', diff --git a/tests/phpunit/tests/customize/nav-menu-item-setting.php b/tests/phpunit/tests/customize/nav-menu-item-setting.php index d99057a5a4..e5c005a49e 100644 --- a/tests/phpunit/tests/customize/nav-menu-item-setting.php +++ b/tests/phpunit/tests/customize/nav-menu-item-setting.php @@ -584,7 +584,7 @@ class Test_WP_Customize_Nav_Menu_Item_Setting extends WP_UnitTestCase { ); $sanitized = $setting->sanitize( $unsanitized ); - $this->assertEqualSets( array_keys( $unsanitized ), array_keys( $sanitized ) ); + $this->assertSameSets( array_keys( $unsanitized ), array_keys( $sanitized ) ); foreach ( $expected_sanitized as $key => $value ) { $this->assertSame( $value, $sanitized[ $key ], "Expected $key to be sanitized." ); diff --git a/tests/phpunit/tests/customize/nav-menu-setting.php b/tests/phpunit/tests/customize/nav-menu-setting.php index cb759ebeaf..6746b8b1f4 100644 --- a/tests/phpunit/tests/customize/nav-menu-setting.php +++ b/tests/phpunit/tests/customize/nav-menu-setting.php @@ -202,7 +202,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { $term = (array) wp_get_nav_menu_object( $menu_id ); - $this->assertEqualSets( + $this->assertSameSets( wp_array_slice_assoc( $value, array( 'name', 'description', 'parent' ) ), wp_array_slice_assoc( $term, array( 'name', 'description', 'parent' ) ) ); @@ -213,7 +213,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { $this->assertSame( 'Description 2 \\o/', $value['description'] ); $this->assertSame( 1, $value['parent'] ); $term = (array) wp_get_nav_menu_object( $menu_id ); - $this->assertEqualSets( $value, wp_array_slice_assoc( $term, array_keys( $value ) ) ); + $this->assertSameSets( $value, wp_array_slice_assoc( $term, array_keys( $value ) ) ); $menu_object = wp_get_nav_menu_object( $menu_id ); $this->assertEquals( (object) $term, $menu_object ); @@ -256,7 +256,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { $term = (array) wp_get_nav_menu_object( $menu_id ); $this->assertNotEmpty( $term ); $this->assertNotWPError( $term ); - $this->assertEqualSets( $post_value, wp_array_slice_assoc( $term, array_keys( $value ) ) ); + $this->assertSameSets( $post_value, wp_array_slice_assoc( $term, array_keys( $value ) ) ); $this->assertSame( $menu_id, $term['term_id'] ); $this->assertSame( $menu_id, $term['term_taxonomy_id'] ); @@ -338,7 +338,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { $this->assertSame( 'New line \\o/', $sanitized['description'] ); $this->assertSame( 0, $sanitized['parent'] ); $this->assertTrue( $sanitized['auto_add'] ); - $this->assertEqualSets( array( 'name', 'description', 'parent', 'auto_add' ), array_keys( $sanitized ) ); + $this->assertSameSets( array( 'name', 'description', 'parent', 'auto_add' ), array_keys( $sanitized ) ); $value['name'] = ' '; // Blank spaces. $sanitized = $setting->sanitize( $value ); @@ -385,7 +385,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { foreach ( array( 'name', 'description', 'parent' ) as $key ) { $this->assertSame( $new_value[ $key ], $menu_object->$key ); } - $this->assertEqualSets( + $this->assertSameSets( wp_array_slice_assoc( $new_value, array( 'name', 'description', 'parent' ) ), wp_array_slice_assoc( (array) $menu_object, array( 'name', 'description', 'parent' ) ) ); @@ -441,7 +441,7 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase { $menu = wp_get_nav_menu_object( $setting->term_id ); unset( $post_value['auto_add'] ); - $this->assertEqualSets( $post_value, wp_array_slice_assoc( (array) $menu, array_keys( $post_value ) ) ); + $this->assertSameSets( $post_value, wp_array_slice_assoc( (array) $menu, array_keys( $post_value ) ) ); $save_response = apply_filters( 'customize_save_response', array() ); $this->assertArrayHasKey( 'nav_menu_updates', $save_response ); diff --git a/tests/phpunit/tests/customize/nav-menus.php b/tests/phpunit/tests/customize/nav-menus.php index d06fc3684a..282988c081 100644 --- a/tests/phpunit/tests/customize/nav-menus.php +++ b/tests/phpunit/tests/customize/nav-menus.php @@ -442,7 +442,7 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $expected, $results[0] ); + $this->assertSameSets( $expected, $results[0] ); } /** @@ -1023,7 +1023,7 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { // Ensure that unique slugs were assigned. $posts = array_map( 'get_post', $drafted_post_ids ); $post_names = wp_list_pluck( $posts, 'post_name' ); - $this->assertEqualSets( $post_names, array_unique( $post_names ) ); + $this->assertSameSets( $post_names, array_unique( $post_names ) ); } /** diff --git a/tests/phpunit/tests/customize/partial.php b/tests/phpunit/tests/customize/partial.php index 0a44a167b9..e73ac56f0b 100644 --- a/tests/phpunit/tests/customize/partial.php +++ b/tests/phpunit/tests/customize/partial.php @@ -106,7 +106,7 @@ class Test_WP_Customize_Partial extends WP_UnitTestCase { $this->assertSame( $this->selective_refresh, $partial->component ); $this->assertSame( $args['type'], $partial->type ); $this->assertSame( $args['selector'], $partial->selector ); - $this->assertEqualSets( $args['settings'], $partial->settings ); + $this->assertSameSets( $args['settings'], $partial->settings ); $this->assertSame( $args['primary_setting'], $partial->primary_setting ); $this->assertSame( $args['render_callback'], $partial->render_callback ); $this->assertFalse( $partial->container_inclusive ); diff --git a/tests/phpunit/tests/customize/selective-refresh-ajax.php b/tests/phpunit/tests/customize/selective-refresh-ajax.php index 7690ff46ea..2f6e4a0f3b 100644 --- a/tests/phpunit/tests/customize/selective-refresh-ajax.php +++ b/tests/phpunit/tests/customize/selective-refresh-ajax.php @@ -377,7 +377,7 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase { $this->assertInternalType( 'array', $response ); $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); if ( isset( $this->expected_partial_ids ) ) { - $this->assertEqualSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); + $this->assertSameSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); } return $response; } @@ -398,7 +398,7 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase { function handle_action_customize_render_partials_after( $component, $partial_placements ) { $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); if ( isset( $this->expected_partial_ids ) ) { - $this->assertEqualSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); + $this->assertSameSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); } } @@ -411,7 +411,7 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase { function handle_action_customize_render_partials_before( $component, $partial_placements ) { $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); if ( isset( $this->expected_partial_ids ) ) { - $this->assertEqualSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); + $this->assertSameSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); } } diff --git a/tests/phpunit/tests/customize/selective-refresh.php b/tests/phpunit/tests/customize/selective-refresh.php index 8e406cf2b6..cd0ce2ebc6 100644 --- a/tests/phpunit/tests/customize/selective-refresh.php +++ b/tests/phpunit/tests/customize/selective-refresh.php @@ -95,7 +95,7 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase { $partial = new WP_Customize_Partial( $this->selective_refresh, 'bar' ); $this->assertSame( $partial, $this->selective_refresh->add_partial( $partial ) ); $this->assertSame( $partial, $this->selective_refresh->get_partial( 'bar' ) ); - $this->assertEqualSets( array( 'bar' ), array_keys( $this->selective_refresh->partials() ) ); + $this->assertSameSets( array( 'bar' ), array_keys( $this->selective_refresh->partials() ) ); add_filter( 'customize_dynamic_partial_args', array( $this, 'filter_customize_dynamic_partial_args' ), 10, 2 ); add_filter( 'customize_dynamic_partial_class', array( $this, 'filter_customize_dynamic_partial_class' ), 10, 3 ); @@ -190,7 +190,7 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase { add_filter( 'customize_dynamic_partial_class', array( $this, 'filter_customize_dynamic_partial_class' ), 10, 3 ); $partials = $this->selective_refresh->add_dynamic_partials( $partial_ids ); - $this->assertEqualSets( array( 'recognized', 'recognized-class' ), wp_list_pluck( $partials, 'id' ) ); + $this->assertSameSets( array( 'recognized', 'recognized-class' ), wp_list_pluck( $partials, 'id' ) ); $this->assertInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized-class' ) ); $this->assertNotInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized' ) ); diff --git a/tests/phpunit/tests/customize/widgets.php b/tests/phpunit/tests/customize/widgets.php index f16f1e6047..5abaa0f45b 100644 --- a/tests/phpunit/tests/customize/widgets.php +++ b/tests/phpunit/tests/customize/widgets.php @@ -32,7 +32,7 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase { unset( $GLOBALS['_wp_sidebars_widgets'] ); // Clear out cache set by wp_get_sidebars_widgets(). $sidebars_widgets = wp_get_sidebars_widgets(); - $this->assertEqualSets( array( 'wp_inactive_widgets', 'sidebar-1', 'sidebar-2' ), array_keys( wp_get_sidebars_widgets() ) ); + $this->assertSameSets( array( 'wp_inactive_widgets', 'sidebar-1', 'sidebar-2' ), array_keys( wp_get_sidebars_widgets() ) ); $this->assertContains( 'search-2', $sidebars_widgets['sidebar-1'] ); $this->assertContains( 'categories-2', $sidebars_widgets['sidebar-2'] ); $this->assertArrayHasKey( 2, get_option( 'widget_search' ) ); diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index d55ac179f7..a715ba822c 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -300,7 +300,7 @@ class Tests_DB extends WP_UnitTestCase { $wpdb->set_sql_mode( $new_modes ); $check_new_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' ); - $this->assertEqualSets( $new_modes, explode( ',', $check_new_modes ) ); + $this->assertSameSets( $new_modes, explode( ',', $check_new_modes ) ); $wpdb->set_sql_mode( explode( ',', $current_modes ) ); } diff --git a/tests/phpunit/tests/dependencies/jquery.php b/tests/phpunit/tests/dependencies/jquery.php index 33cbb3693e..2ca47af409 100644 --- a/tests/phpunit/tests/dependencies/jquery.php +++ b/tests/phpunit/tests/dependencies/jquery.php @@ -26,7 +26,7 @@ class Tests_Dependencies_jQuery extends WP_UnitTestCase { // Disable, but keep the following test for 5.6 when jQuery would be updated to 3.5.1+ and // the latest Migrate will be used. /* - $this->assertEqualSets( $object->deps, array_keys( $jquery_scripts ) ); + $this->assertSameSets( $object->deps, array_keys( $jquery_scripts ) ); foreach ( $object->deps as $dep ) { $o = $scripts->query( $dep, 'registered' ); $this->assertInstanceOf( '_WP_Dependency', $object ); diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index bf286822ec..4960e8ef8e 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -1052,8 +1052,8 @@ JS; $wp_enqueue_code_editor = wp_enqueue_code_editor( array( 'file' => $real_file ) ); $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); - $this->assertEqualSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); + $this->assertSameSets( array( 'autoCloseBrackets', 'autoCloseTags', @@ -1075,7 +1075,7 @@ JS; ); $this->assertEmpty( $wp_enqueue_code_editor['codemirror']['gutters'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'errors', 'box-model', @@ -1087,7 +1087,7 @@ JS; array_keys( $wp_enqueue_code_editor['csslint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'boss', 'curly', @@ -1109,7 +1109,7 @@ JS; array_keys( $wp_enqueue_code_editor['jshint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'tagname-lowercase', 'attr-lowercase', @@ -1139,8 +1139,8 @@ JS; $wp_enqueue_code_editor = wp_enqueue_code_editor( compact( 'file' ) ); $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); - $this->assertEqualSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); + $this->assertSameSets( array( 'continueComments', 'direction', @@ -1158,7 +1158,7 @@ JS; ); $this->assertEmpty( $wp_enqueue_code_editor['codemirror']['gutters'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'errors', 'box-model', @@ -1170,7 +1170,7 @@ JS; array_keys( $wp_enqueue_code_editor['csslint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'boss', 'curly', @@ -1192,7 +1192,7 @@ JS; array_keys( $wp_enqueue_code_editor['jshint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'tagname-lowercase', 'attr-lowercase', @@ -1233,8 +1233,8 @@ JS; $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); - $this->assertEqualSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); + $this->assertSameSets( array( 'autoCloseBrackets', 'continueComments', @@ -1255,7 +1255,7 @@ JS; array_keys( $wp_enqueue_code_editor['codemirror'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'errors', 'box-model', @@ -1267,7 +1267,7 @@ JS; array_keys( $wp_enqueue_code_editor['csslint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'boss', 'curly', @@ -1289,7 +1289,7 @@ JS; array_keys( $wp_enqueue_code_editor['jshint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'tagname-lowercase', 'attr-lowercase', @@ -1327,8 +1327,8 @@ JS; $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); - $this->assertEqualSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'codemirror', 'csslint', 'jshint', 'htmlhint' ), array_keys( $wp_enqueue_code_editor ) ); + $this->assertSameSets( array( 'autoCloseBrackets', 'continueComments', @@ -1349,7 +1349,7 @@ JS; array_keys( $wp_enqueue_code_editor['codemirror'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'errors', 'box-model', @@ -1361,7 +1361,7 @@ JS; array_keys( $wp_enqueue_code_editor['csslint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'boss', 'curly', @@ -1383,7 +1383,7 @@ JS; array_keys( $wp_enqueue_code_editor['jshint'] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'tagname-lowercase', 'attr-lowercase', diff --git a/tests/phpunit/tests/editor/wpEditors.php b/tests/phpunit/tests/editor/wpEditors.php index 495701384c..bb159c64c6 100644 --- a/tests/phpunit/tests/editor/wpEditors.php +++ b/tests/phpunit/tests/editor/wpEditors.php @@ -32,7 +32,7 @@ class Tests_WP_Editors extends WP_UnitTestCase { $post = self::factory()->post->create_and_get( array( 'post_status' => 'publish' ) ); $actual = _WP_Editors::wp_link_query( array( 's' => $post->post_title ) ); - $this->assertEqualSets( + $this->assertSameSets( array( array( 'ID' => $post->ID, @@ -53,7 +53,7 @@ class Tests_WP_Editors extends WP_UnitTestCase { $actual = _WP_Editors::wp_link_query( array( 's' => 'foobarbaz' ) ); remove_filter( 'wp_link_query', array( $this, 'wp_link_query_callback' ) ); - $this->assertEqualSets( + $this->assertSameSets( array( array( 'ID' => 123, @@ -73,7 +73,7 @@ class Tests_WP_Editors extends WP_UnitTestCase { $actual = _WP_Editors::wp_link_query( array( 's' => $post->post_title ) ); remove_filter( 'wp_link_query', array( $this, 'wp_link_query_callback' ) ); - $this->assertEqualSets( + $this->assertSameSets( array( array( 'ID' => $post->ID, diff --git a/tests/phpunit/tests/functions/allowedProtocols.php b/tests/phpunit/tests/functions/allowedProtocols.php index 9caf236074..ad80a6c855 100644 --- a/tests/phpunit/tests/functions/allowedProtocols.php +++ b/tests/phpunit/tests/functions/allowedProtocols.php @@ -18,7 +18,7 @@ class Tests_Functions_AllowedProtocols extends WP_UnitTestCase { foreach ( $this->data_example_urls() as $example ) { $example_protocols[] = $example[0]; } - $this->assertEqualSets( $example_protocols, wp_allowed_protocols() ); + $this->assertSameSets( $example_protocols, wp_allowed_protocols() ); } /** diff --git a/tests/phpunit/tests/functions/wpListUtil.php b/tests/phpunit/tests/functions/wpListUtil.php index 6368b87d05..82265845b9 100644 --- a/tests/phpunit/tests/functions/wpListUtil.php +++ b/tests/phpunit/tests/functions/wpListUtil.php @@ -73,9 +73,9 @@ class Tests_Functions_wpListUtil extends WP_UnitTestCase { 'foo', 'key', array( + 'bar', 'bar' => 'foo', 'value' => 'baz', - 'bar', ), ), 'objects' => array( @@ -144,9 +144,9 @@ class Tests_Functions_wpListUtil extends WP_UnitTestCase { 'foo', 'key', array( + 'bar', 'bar' => 'foo', 'value' => 'baz', - 'bar', ), ), ); @@ -161,7 +161,7 @@ class Tests_Functions_wpListUtil extends WP_UnitTestCase { * @param array $expected Expected result. */ public function test_wp_list_pluck( $list, $field, $index_key, $expected ) { - $this->assertEqualSetsWithIndex( $expected, wp_list_pluck( $list, $field, $index_key ) ); + $this->assertSameSetsWithIndex( $expected, wp_list_pluck( $list, $field, $index_key ) ); } public function data_test_wp_list_filter() { @@ -1023,14 +1023,14 @@ class Tests_Functions_wpListUtil extends WP_UnitTestCase { $input = array( 'foo', 'bar' ); $util = new WP_List_Util( $input ); - $this->assertEqualSets( $input, $util->get_input() ); + $this->assertSameSets( $input, $util->get_input() ); } public function test_wp_list_util_get_output_immediately() { $input = array( 'foo', 'bar' ); $util = new WP_List_Util( $input ); - $this->assertEqualSets( $input, $util->get_output() ); + $this->assertSameSets( $input, $util->get_output() ); } public function test_wp_list_util_get_output() { diff --git a/tests/phpunit/tests/general/wpError.php b/tests/phpunit/tests/general/wpError.php index 1a7e36c1d8..16daca9889 100644 --- a/tests/phpunit/tests/general/wpError.php +++ b/tests/phpunit/tests/general/wpError.php @@ -112,7 +112,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_get_error_codes_with_one_error_should_return_an_array_with_only_that_code() { $this->wp_error->add( 'code', 'message' ); - $this->assertEqualSets( array( 'code' ), $this->wp_error->get_error_codes() ); + $this->assertSameSets( array( 'code' ), $this->wp_error->get_error_codes() ); } /** @@ -124,7 +124,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $expected = array( 'code', 'code2' ); - $this->assertEqualSets( $expected, $this->wp_error->get_error_codes() ); + $this->assertSameSets( $expected, $this->wp_error->get_error_codes() ); } /** @@ -166,7 +166,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_get_error_messages_with_empty_code_one_error_should_return_an_array_with_that_message() { $this->wp_error->add( 'code', 'message' ); - $this->assertEqualSets( array( 'message' ), $this->wp_error->get_error_messages() ); + $this->assertSameSets( array( 'message' ), $this->wp_error->get_error_messages() ); } /** @@ -176,7 +176,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add( 'code', 'message' ); $this->wp_error->add( 'code2', 'message2' ); - $this->assertEqualSets( array( 'message', 'message2' ), $this->wp_error->get_error_messages() ); + $this->assertSameSets( array( 'message', 'message2' ), $this->wp_error->get_error_messages() ); } /** @@ -192,7 +192,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_get_error_messages_with_one_error_should_return_an_array_with_that_message() { $this->wp_error->add( 'code', 'message' ); - $this->assertEqualSets( array( 'message' ), $this->wp_error->get_error_messages( 'code' ) ); + $this->assertSameSets( array( 'message' ), $this->wp_error->get_error_messages( 'code' ) ); } /** @@ -301,7 +301,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $expected = array( 'data-key' => 'data-value' ); $this->wp_error->add( 'code', 'message', $expected ); - $this->assertEqualSetsWithIndex( $expected, $this->wp_error->get_error_data() ); + $this->assertSameSetsWithIndex( $expected, $this->wp_error->get_error_data() ); } /** @@ -312,7 +312,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add( 'code', 'message', $expected ); $this->wp_error->add( 'code2', 'message2', 'data2' ); - $this->assertEqualSetsWithIndex( $expected, $this->wp_error->get_error_data() ); + $this->assertSameSetsWithIndex( $expected, $this->wp_error->get_error_data() ); } /** @@ -349,7 +349,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $expected = array( 'data-key' => 'data-value' ); $this->wp_error->add( 'code', 'message', $expected ); - $this->assertEqualSetsWithIndex( $expected, $this->wp_error->get_error_data( 'code' ) ); + $this->assertSameSetsWithIndex( $expected, $this->wp_error->get_error_data( 'code' ) ); } /** @@ -361,7 +361,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add( 'code2', 'message2', 'data2' ); $this->wp_error->add( 'code', 'message3', $expected ); - $this->assertEqualSetsWithIndex( $expected, $this->wp_error->get_error_data( 'code' ) ); + $this->assertSameSetsWithIndex( $expected, $this->wp_error->get_error_data( 'code' ) ); } /** @@ -405,7 +405,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_add_with_empty_code_empty_message_empty_data_should_add_empty_message_to_errors_array_under_empty_key() { $this->wp_error->add( '', '', 'data' ); - $this->assertEqualSetsWithIndex( array( '' => array( '' ) ), $this->wp_error->errors ); + $this->assertSameSetsWithIndex( array( '' => array( '' ) ), $this->wp_error->errors ); } /** @@ -423,7 +423,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_add_with_empty_code_empty_message_non_empty_data_should_store_data_under_an_empty_code_key() { $this->wp_error->add( '', '', 'data' ); - $this->assertEqualSetsWithIndex( array( '' => 'data' ), $this->wp_error->error_data ); + $this->assertSameSetsWithIndex( array( '' => 'data' ), $this->wp_error->error_data ); } /** @@ -525,7 +525,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $expected = array( 'message', 'message2' ); - $this->assertEqualSets( $expected, $this->wp_error->get_error_messages( 'code' ) ); + $this->assertSameSets( $expected, $this->wp_error->get_error_messages( 'code' ) ); } /** @@ -553,7 +553,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_add_data_with_empty_data_empty_code_no_errors_should_create_data_under_an_empty_code_key() { $this->wp_error->add_data( '' ); - $this->assertEqualSets( array( '' => '' ), $this->wp_error->error_data ); + $this->assertSameSets( array( '' => '' ), $this->wp_error->error_data ); } /** @@ -606,7 +606,7 @@ class Tests_WP_Error extends WP_UnitTestCase { public function test_add_data_with_data_and_code_no_errors_should_create_data_under_that_code_key() { $this->wp_error->add_data( 'data', 'code' ); - $this->assertEqualSets( array( 'code' => 'data' ), $this->wp_error->error_data ); + $this->assertSameSets( array( 'code' => 'data' ), $this->wp_error->error_data ); } /** @@ -617,7 +617,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add_data( 'data', 'code2' ); - $this->assertEqualSetsWithIndex( array( 'code' => array( 'message' ) ), $this->wp_error->errors ); + $this->assertSameSetsWithIndex( array( 'code' => array( 'message' ) ), $this->wp_error->errors ); } /** @@ -628,7 +628,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add_data( 'data', 'code2' ); - $this->assertEqualSetsWithIndex( array( 'code2' => 'data' ), $this->wp_error->error_data ); + $this->assertSameSetsWithIndex( array( 'code2' => 'data' ), $this->wp_error->error_data ); } /** @@ -652,7 +652,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $after = $this->wp_error->errors; - $this->assertEqualSetsWithIndex( $before, $after ); + $this->assertSameSetsWithIndex( $before, $after ); } /** @@ -665,7 +665,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $after = $this->wp_error->errors; - $this->assertEqualSetsWithIndex( $before, $after ); + $this->assertSameSetsWithIndex( $before, $after ); } /** @@ -680,7 +680,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $after = $this->wp_error->errors; - $this->assertEqualSetsWithIndex( $before, $after ); + $this->assertSameSetsWithIndex( $before, $after ); } /** diff --git a/tests/phpunit/tests/hooks/iterator.php b/tests/phpunit/tests/hooks/iterator.php index 5592880b0c..a569fd4952 100644 --- a/tests/phpunit/tests/hooks/iterator.php +++ b/tests/phpunit/tests/hooks/iterator.php @@ -26,7 +26,7 @@ class Tests_WP_Hook_Iterator extends WP_UnitTestCase { $functions[] = $the_['function']; } } - $this->assertEqualSets( array( $priority, $priority + 1 ), $priorities ); - $this->assertEqualSets( array( $callback_one, $callback_two ), $functions ); + $this->assertSameSets( array( $priority, $priority + 1 ), $priorities ); + $this->assertSameSets( array( $callback_one, $callback_two ), $functions ); } } diff --git a/tests/phpunit/tests/includes/helpers.php b/tests/phpunit/tests/includes/helpers.php index c17a7006ae..451ccaa64c 100644 --- a/tests/phpunit/tests/includes/helpers.php +++ b/tests/phpunit/tests/includes/helpers.php @@ -7,7 +7,7 @@ class Tests_TestHelpers extends WP_UnitTestCase { /** * @ticket 30522 */ - function data_assertEqualSets() { + function data_assertSameSets() { return array( array( array( 1, 2, 3 ), // Test expected. @@ -48,27 +48,27 @@ class Tests_TestHelpers extends WP_UnitTestCase { } /** - * @dataProvider data_assertEqualSets + * @dataProvider data_assertSameSets * @ticket 30522 */ - function test_assertEqualSets( $expected, $actual, $exception ) { + function test_assertSameSets( $expected, $actual, $exception ) { if ( $exception ) { try { - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } catch ( PHPUnit_Framework_ExpectationFailedException $ex ) { return; } $this->fail(); } else { - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } } /** * @ticket 30522 */ - function data_assertEqualSetsWithIndex() { + function data_assertSameSetsWithIndex() { return array( array( array( 1, 2, 3 ), // Test expected. @@ -204,20 +204,20 @@ class Tests_TestHelpers extends WP_UnitTestCase { ); } /** - * @dataProvider data_assertEqualSetsWithIndex + * @dataProvider data_assertSameSetsWithIndex * @ticket 30522 */ - function test_assertEqualSetsWithIndex( $expected, $actual, $exception ) { + function test_assertSameSetsWithIndex( $expected, $actual, $exception ) { if ( $exception ) { try { - $this->assertEqualSetsWithIndex( $expected, $actual ); + $this->assertSameSetsWithIndex( $expected, $actual ); } catch ( PHPUnit_Framework_ExpectationFailedException $ex ) { return; } $this->fail(); } else { - $this->assertEqualSetsWithIndex( $expected, $actual ); + $this->assertSameSetsWithIndex( $expected, $actual ); } } @@ -312,7 +312,7 @@ class Tests_TestHelpers extends WP_UnitTestCase { $this->assertSame( $expected['title'], $title ); // Only check arguments that are explicitly asked for. - $this->assertEqualSets( $expected['args'], array_intersect_key( $args, $expected['args'] ) ); + $this->assertSameSets( $expected['args'], array_intersect_key( $args, $expected['args'] ) ); } public function data_die_process_input() { diff --git a/tests/phpunit/tests/l10n.php b/tests/phpunit/tests/l10n.php index f39bdb8307..d62ca1f532 100644 --- a/tests/phpunit/tests/l10n.php +++ b/tests/phpunit/tests/l10n.php @@ -72,7 +72,7 @@ class Tests_L10n extends WP_UnitTestCase { $installed_translations = wp_get_installed_translations( 'core' ); $this->assertInternalType( 'array', $installed_translations ); $textdomains_expected = array( 'admin', 'admin-network', 'continents-cities', 'default' ); - $this->assertEqualSets( $textdomains_expected, array_keys( $installed_translations ) ); + $this->assertSameSets( $textdomains_expected, array_keys( $installed_translations ) ); $this->assertNotEmpty( $installed_translations['default']['en_GB'] ); $data_en_gb = $installed_translations['default']['en_GB']; diff --git a/tests/phpunit/tests/l10n/localeSwitcher.php b/tests/phpunit/tests/l10n/localeSwitcher.php index 0621092165..ec86fcbca4 100644 --- a/tests/phpunit/tests/l10n/localeSwitcher.php +++ b/tests/phpunit/tests/l10n/localeSwitcher.php @@ -91,7 +91,7 @@ class Tests_Locale_Switcher extends WP_UnitTestCase { // Cleanup. restore_previous_locale(); - $this->assertEqualSetsWithIndex( $expected, $wp_locale_de_de->number_format ); + $this->assertSameSetsWithIndex( $expected, $wp_locale_de_de->number_format ); } public function test_switch_to_locale_en_US() { @@ -196,7 +196,7 @@ class Tests_Locale_Switcher extends WP_UnitTestCase { switch_to_locale( 'de_DE' ); restore_previous_locale(); - $this->assertEqualSetsWithIndex( $expected, $wp_locale->number_format ); + $this->assertSameSetsWithIndex( $expected, $wp_locale->number_format ); } public function test_restore_current_locale_without_switching() { diff --git a/tests/phpunit/tests/menu/nav-menu.php b/tests/phpunit/tests/menu/nav-menu.php index 467b4ab930..58a597c858 100644 --- a/tests/phpunit/tests/menu/nav-menu.php +++ b/tests/phpunit/tests/menu/nav-menu.php @@ -153,7 +153,7 @@ class Tests_Nav_Menu_Theme_Change extends WP_UnitTestCase { $expected_nav_menu_locations = array( 'main' => 1, ); - $this->assertEqualSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); + $this->assertSameSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); } /** @@ -201,7 +201,7 @@ class Tests_Nav_Menu_Theme_Change extends WP_UnitTestCase { $expected_nav_menu_locations = array( 'primary' => 1, ); - $this->assertEqualSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); + $this->assertSameSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); } /** @@ -228,6 +228,6 @@ class Tests_Nav_Menu_Theme_Change extends WP_UnitTestCase { 0 => 3, ); - $this->assertEqualSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); + $this->assertSameSets( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); } } diff --git a/tests/phpunit/tests/meta/deleteMetadata.php b/tests/phpunit/tests/meta/deleteMetadata.php index a769d00559..ce004291bd 100644 --- a/tests/phpunit/tests/meta/deleteMetadata.php +++ b/tests/phpunit/tests/meta/deleteMetadata.php @@ -10,11 +10,11 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo' ); $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( array(), $m ); + $this->assertSameSets( array(), $m ); } public function test_with_meta_value() { @@ -23,13 +23,13 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo', '1' ); $m = get_metadata( 'post', 12345, 'foo', false ); $expected = array_diff( $vals, array( '1' ) ); - $this->assertEqualSets( $expected, $m ); + $this->assertSameSets( $expected, $m ); } /** @@ -41,13 +41,13 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo', '0' ); $m = get_metadata( 'post', 12345, 'foo', false ); $expected = array_diff( $vals, array( '0' ) ); - $this->assertEqualSets( $expected, $m ); + $this->assertSameSets( $expected, $m ); } /** @@ -61,11 +61,11 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo', '' ); $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( array(), $m ); + $this->assertSameSets( array(), $m ); } /** @@ -77,11 +77,11 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo', null ); $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( array(), $m ); + $this->assertSameSets( array(), $m ); } /** @@ -93,11 +93,11 @@ class Tests_Meta_DeleteMetadata extends WP_UnitTestCase { add_metadata( 'post', 12345, 'foo', $val ); } $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( $vals, $m ); + $this->assertSameSets( $vals, $m ); delete_metadata( 'post', 12345, 'foo', false ); $m = get_metadata( 'post', 12345, 'foo', false ); - $this->assertEqualSets( array(), $m ); + $this->assertSameSets( array(), $m ); } /** diff --git a/tests/phpunit/tests/meta/query.php b/tests/phpunit/tests/meta/query.php index b082ba72e2..bfc604379f 100644 --- a/tests/phpunit/tests/meta/query.php +++ b/tests/phpunit/tests/meta/query.php @@ -758,7 +758,7 @@ class Tests_Meta_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); $q = new WP_Query( array( @@ -770,7 +770,7 @@ class Tests_Meta_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0] ), $q->posts ); + $this->assertSameSets( array( $posts[0] ), $q->posts ); } /** diff --git a/tests/phpunit/tests/multisite/getBlogDetails.php b/tests/phpunit/tests/multisite/getBlogDetails.php index f79b065725..d0c4b81dce 100644 --- a/tests/phpunit/tests/multisite/getBlogDetails.php +++ b/tests/phpunit/tests/multisite/getBlogDetails.php @@ -168,7 +168,7 @@ if ( is_multisite() ) : $result = array_keys( get_object_vars( $site ) ); - $this->assertEqualSets( $this->get_fields( $get_all ), $result ); + $this->assertSameSets( $this->get_fields( $get_all ), $result ); } /** @@ -190,7 +190,7 @@ if ( is_multisite() ) : $result[] = $key; } - $this->assertEqualSets( $this->get_fields( $get_all ), $result ); + $this->assertSameSets( $this->get_fields( $get_all ), $result ); } public function data_get_all() { diff --git a/tests/phpunit/tests/multisite/networkQuery.php b/tests/phpunit/tests/multisite/networkQuery.php index ae06d24161..54248d81e2 100644 --- a/tests/phpunit/tests/multisite/networkQuery.php +++ b/tests/phpunit/tests/multisite/networkQuery.php @@ -109,7 +109,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_network__in_with_multiple_ids() { @@ -123,7 +123,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_network__in_and_count_with_multiple_ids() { @@ -156,7 +156,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_network__not_in_with_multiple_ids() { @@ -174,7 +174,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain() { @@ -190,7 +190,7 @@ if ( is_multisite() ) : self::$network_ids['www.w.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__in_with_single_domain() { @@ -206,7 +206,7 @@ if ( is_multisite() ) : self::$network_ids['make.wordpress.org/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__in_with_multiple_domains() { @@ -223,7 +223,7 @@ if ( is_multisite() ) : self::$network_ids['make.wordpress.org/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__in_with_multiple_domains_and_number() { @@ -240,7 +240,7 @@ if ( is_multisite() ) : self::$network_ids['wordpress.org/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__in_with_multiple_domains_and_number_and_offset() { @@ -258,7 +258,7 @@ if ( is_multisite() ) : self::$network_ids['make.wordpress.org/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__not_in_with_single_domain() { @@ -277,7 +277,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__not_in_with_multiple_domains() { @@ -295,7 +295,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__not_in_with_multiple_domains_and_number() { @@ -313,7 +313,7 @@ if ( is_multisite() ) : self::$network_ids['make.wordpress.org/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_domain__not_in_with_multiple_domains_and_number_and_offset() { @@ -332,7 +332,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_path_with_expected_results() { @@ -351,7 +351,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_path_and_number_and_offset_with_expected_results() { @@ -370,7 +370,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_path_with_no_expected_results() { @@ -398,7 +398,7 @@ if ( is_multisite() ) : self::$network_ids['www.wordpress.net/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_search_with_text_in_path() { @@ -414,7 +414,7 @@ if ( is_multisite() ) : self::$network_ids['www.w.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_network_query_by_path_order_by_domain_desc() { diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 6cce1ac41a..a76e993436 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -1574,7 +1574,7 @@ if ( is_multisite() ) : public function test_wp_normalize_site_data( $data, $expected ) { $result = wp_normalize_site_data( $data ); - $this->assertEqualSetsWithIndex( $expected, $result ); + $this->assertSameSetsWithIndex( $expected, $result ); } public function data_wp_normalize_site_data() { @@ -1657,7 +1657,7 @@ if ( is_multisite() ) : if ( empty( $expected_errors ) ) { $this->assertEmpty( $result->errors ); } else { - $this->assertEqualSets( $expected_errors, array_keys( $result->errors ) ); + $this->assertSameSets( $expected_errors, array_keys( $result->errors ) ); } } @@ -1955,8 +1955,8 @@ if ( is_multisite() ) : $update_result = $this->get_listen_to_site_status_hooks_result(); // Check both insert and update results. - $this->assertEqualSetsWithIndex( $insert_expected, $insert_result ); - $this->assertEqualSetsWithIndex( $update_expected, $update_result ); + $this->assertSameSetsWithIndex( $insert_expected, $insert_result ); + $this->assertSameSetsWithIndex( $update_expected, $update_result ); } public function data_site_status_hook_triggers() { @@ -2187,7 +2187,7 @@ if ( is_multisite() ) : wp_uninitialize_site( self::$uninitialized_site_id ); $this->assertTrue( $result ); - $this->assertEqualSets( + $this->assertSameSets( array( 'administrator', 'editor', @@ -2351,7 +2351,7 @@ if ( is_multisite() ) : $passed_args = $this->wp_initialize_site_args; $this->wp_initialize_site_args = null; - $this->assertEqualSetsWithIndex( $args, $passed_args ); + $this->assertSameSetsWithIndex( $args, $passed_args ); } public function filter_wp_initialize_site_args_catch_args( $args ) { diff --git a/tests/phpunit/tests/multisite/siteMeta.php b/tests/phpunit/tests/multisite/siteMeta.php index dd46058e2f..8cdac5f946 100644 --- a/tests/phpunit/tests/multisite/siteMeta.php +++ b/tests/phpunit/tests/multisite/siteMeta.php @@ -121,7 +121,7 @@ if ( is_multisite() ) : 'foo1' => array( 'baz' ), ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_with_key_should_fetch_all_for_key() { @@ -136,7 +136,7 @@ if ( is_multisite() ) : $found = get_site_meta( self::$site_id, 'foo' ); $expected = array( 'bar', 'baz' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_should_respect_single_true() { @@ -299,7 +299,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id ), $found ); + $this->assertSameSets( array( self::$site_id ), $found ); add_site_meta( self::$site_id2, 'foo', 'bar' ); @@ -315,7 +315,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id, self::$site_id2 ), $found ); + $this->assertSameSets( array( self::$site_id, self::$site_id2 ), $found ); } /** @@ -342,7 +342,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id ), $found ); + $this->assertSameSets( array( self::$site_id ), $found ); update_site_meta( self::$site_id2, 'foo', 'bar' ); @@ -358,7 +358,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id, self::$site_id2 ), $found ); + $this->assertSameSets( array( self::$site_id, self::$site_id2 ), $found ); } /** @@ -385,7 +385,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id, self::$site_id2 ), $found ); + $this->assertSameSets( array( self::$site_id, self::$site_id2 ), $found ); delete_site_meta( self::$site_id2, 'foo', 'bar' ); @@ -401,7 +401,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_id ), $found ); + $this->assertSameSets( array( self::$site_id ), $found ); } } diff --git a/tests/phpunit/tests/multisite/siteQuery.php b/tests/phpunit/tests/multisite/siteQuery.php index def4f7d824..6f8f48f4a8 100644 --- a/tests/phpunit/tests/multisite/siteQuery.php +++ b/tests/phpunit/tests/multisite/siteQuery.php @@ -123,7 +123,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array( self::$site_ids['www.w.org/'] ), $found ); + $this->assertSameSets( array( self::$site_ids['www.w.org/'] ), $found ); } public function test_wp_site_query_by_number() { @@ -149,7 +149,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_site__in_with_multiple_ids() { @@ -163,7 +163,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -199,7 +199,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_site__not_in_with_multiple_ids() { @@ -217,7 +217,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_network_id_with_order() { @@ -265,7 +265,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_network_id_with_no_existing_sites() { @@ -296,7 +296,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain_and_offset() { @@ -315,7 +315,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain_and_number_and_offset() { @@ -334,7 +334,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain__in_with_single_domain() { @@ -351,7 +351,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain__in_with_multiple_domains() { @@ -371,7 +371,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain__not_in_with_single_domain() { @@ -392,7 +392,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_domain__not_in_with_multiple_domains() { @@ -410,7 +410,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_path_with_expected_results() { @@ -427,7 +427,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_path_with_no_expected_results() { @@ -455,7 +455,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_mature() { @@ -469,7 +469,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_spam() { @@ -483,7 +483,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_deleted() { @@ -497,7 +497,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_deleted_with_no_results() { @@ -523,7 +523,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_lang_id_with_zero() { @@ -537,7 +537,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_diff( array_values( self::$site_ids ), array( self::$site_ids['www.w.org/make/'] ) ), $found ); + $this->assertSameSets( array_diff( array_values( self::$site_ids ), array( self::$site_ids['www.w.org/make/'] ) ), $found ); } public function test_wp_site_query_by_lang_id() { @@ -553,7 +553,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_lang_id_with_no_results() { @@ -581,7 +581,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_lang__in_with_multiple_ids() { @@ -595,7 +595,7 @@ if ( is_multisite() ) : ) ); - $this->assertEqualSets( array_values( self::$site_ids ), $found ); + $this->assertSameSets( array_values( self::$site_ids ), $found ); } public function test_wp_site_query_by_lang__not_in() { @@ -611,7 +611,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_lang__not_in_with_multiple_ids() { @@ -640,7 +640,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_search_with_text_in_path() { @@ -660,7 +660,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_search_with_text_in_path_and_domain() { @@ -678,7 +678,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_search_with_text_in_path_and_domain_order_by_domain_desc() { @@ -751,7 +751,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_search_with_wildcard_in_text_exclude_path_from_search() { @@ -769,7 +769,7 @@ if ( is_multisite() ) : self::$site_ids['make.wordpress.org/foo/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_site_query_by_search_with_wildcard_in_text_exclude_domain_from_search() { @@ -786,7 +786,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/make/'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -905,7 +905,7 @@ if ( is_multisite() ) : if ( $strict ) { $this->assertSame( $expected, $found ); } else { - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } } diff --git a/tests/phpunit/tests/multisite/wpMSSitesListTable.php b/tests/phpunit/tests/multisite/wpMSSitesListTable.php index 39c9161a30..a49369cca5 100644 --- a/tests/phpunit/tests/multisite/wpMSSitesListTable.php +++ b/tests/phpunit/tests/multisite/wpMSSitesListTable.php @@ -93,7 +93,7 @@ if ( is_multisite() ) : $items = wp_list_pluck( $this->table->items, 'blog_id' ); $items = array_map( 'intval', $items ); - $this->assertEqualSets( array( 1 ) + self::$site_ids, $items ); + $this->assertSameSets( array( 1 ) + self::$site_ids, $items ); } public function test_ms_sites_list_table_subdirectory_path_search_items() { @@ -119,7 +119,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $items ); + $this->assertSameSets( $expected, $items ); } public function test_ms_sites_list_table_subdirectory_multiple_path_search_items() { @@ -141,7 +141,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $items ); + $this->assertSameSets( $expected, $items ); } public function test_ms_sites_list_table_invalid_path_search_items() { @@ -178,7 +178,7 @@ if ( is_multisite() ) : self::$site_ids['atest.example.org/'], ); - $this->assertEqualSets( $expected, $items ); + $this->assertSameSets( $expected, $items ); } public function test_ms_sites_list_table_subdomain_domain_search_items_with_trailing_wildcard() { @@ -202,7 +202,7 @@ if ( is_multisite() ) : self::$site_ids['atest.example.org/'], ); - $this->assertEqualSets( $expected, $items ); + $this->assertSameSets( $expected, $items ); } public function test_ms_sites_list_table_subdirectory_path_search_items_with_trailing_wildcard() { @@ -228,7 +228,7 @@ if ( is_multisite() ) : self::$site_ids['www.w.org/foo/bar/'], ); - $this->assertEqualSets( $expected, $items ); + $this->assertSameSets( $expected, $items ); } } endif; diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php index ac5e694d44..fea9500d47 100644 --- a/tests/phpunit/tests/oembed/WpEmbed.php +++ b/tests/phpunit/tests/oembed/WpEmbed.php @@ -58,14 +58,14 @@ class Tests_WP_Embed extends WP_UnitTestCase { } public function test_wp_maybe_load_embeds() { - $this->assertEqualSets( array( 10, 9999 ), array_keys( $GLOBALS['wp_embed']->handlers ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 10, 9999 ), array_keys( $GLOBALS['wp_embed']->handlers ) ); + $this->assertSameSets( array( 'youtube_embed_url', ), array_keys( $GLOBALS['wp_embed']->handlers[10] ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'audio', 'video', diff --git a/tests/phpunit/tests/oembed/getResponseData.php b/tests/phpunit/tests/oembed/getResponseData.php index 661d8ca896..9beaf56e7e 100644 --- a/tests/phpunit/tests/oembed/getResponseData.php +++ b/tests/phpunit/tests/oembed/getResponseData.php @@ -17,7 +17,7 @@ class Tests_oEmbed_Response_Data extends WP_UnitTestCase { $data = get_oembed_response_data( $post, 400 ); - $this->assertEqualSets( + $this->assertSameSets( array( 'version' => '1.0', 'provider_name' => get_bloginfo( 'name' ), @@ -53,7 +53,7 @@ class Tests_oEmbed_Response_Data extends WP_UnitTestCase { $data = get_oembed_response_data( $post, 400 ); - $this->assertEqualSets( + $this->assertSameSets( array( 'version' => '1.0', 'provider_name' => get_bloginfo( 'name' ), @@ -81,7 +81,7 @@ class Tests_oEmbed_Response_Data extends WP_UnitTestCase { $data = get_oembed_response_data( $post, 600 ); - $this->assertEqualSets( + $this->assertSameSets( array( 'version' => '1.0', 'provider_name' => get_bloginfo( 'name' ), diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index f70304ba98..8c5cb0000f 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -1378,12 +1378,12 @@ class Tests_Post extends WP_UnitTestCase { $post = get_post( $post_id ); $tags = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $tag_1['term_id'], $tag_2['term_id'] ), $tags ); + $this->assertSameSets( array( $tag_1['term_id'], $tag_2['term_id'] ), $tags ); wp_update_post( $post ); $tags = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $tag_1['term_id'], $tag_2['term_id'] ), $tags ); + $this->assertSameSets( array( $tag_1['term_id'], $tag_2['term_id'] ), $tags ); wp_update_post( array( @@ -1393,6 +1393,6 @@ class Tests_Post extends WP_UnitTestCase { ); $tags = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $tag_2['term_id'], $tag_3['term_id'] ), $tags ); + $this->assertSameSets( array( $tag_2['term_id'], $tag_3['term_id'] ), $tags ); } } diff --git a/tests/phpunit/tests/post/getPageChildren.php b/tests/phpunit/tests/post/getPageChildren.php index 379f72776c..c64b7550cf 100644 --- a/tests/phpunit/tests/post/getPageChildren.php +++ b/tests/phpunit/tests/post/getPageChildren.php @@ -68,7 +68,7 @@ class Tests_Post_GetPageChildren extends WP_UnitTestCase { public function test_page_id_0_should_return_all_pages_in_tree_and_exclude_pages_not_in_tree() { $expected = array( 100, 101, 102, 103, 105, 106, 107, 108 ); $actual = get_page_children( 0, $this->pages ); - $this->assertEqualSets( $expected, wp_list_pluck( $actual, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $actual, 'ID' ) ); } public function test_hierarchical_order_should_be_respected_in_results() { diff --git a/tests/phpunit/tests/post/getPages.php b/tests/phpunit/tests/post/getPages.php index c85ead1685..4950b5abb7 100644 --- a/tests/phpunit/tests/post/getPages.php +++ b/tests/phpunit/tests/post/getPages.php @@ -124,7 +124,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $cached_ids = wp_list_pluck( $cached, 'ID' ); - $this->assertEqualSets( array( $posts[0] ), $cached_ids ); + $this->assertSameSets( array( $posts[0] ), $cached_ids ); add_post_meta( $posts[1], 'foo', 'bar' ); @@ -136,7 +136,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $found_ids = wp_list_pluck( $found, 'ID' ); - $this->assertEqualSets( $posts, $found_ids ); + $this->assertSameSets( $posts, $found_ids ); } /** @@ -161,7 +161,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $cached_ids = wp_list_pluck( $cached, 'ID' ); - $this->assertEqualSets( $posts, $cached_ids ); + $this->assertSameSets( $posts, $cached_ids ); update_post_meta( $posts[1], 'foo', 'baz' ); @@ -173,7 +173,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $found_ids = wp_list_pluck( $found, 'ID' ); - $this->assertEqualSets( array( $posts[0] ), $found_ids ); + $this->assertSameSets( array( $posts[0] ), $found_ids ); } /** @@ -198,7 +198,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $cached_ids = wp_list_pluck( $cached, 'ID' ); - $this->assertEqualSets( $posts, $cached_ids ); + $this->assertSameSets( $posts, $cached_ids ); delete_post_meta( $posts[1], 'foo' ); @@ -210,7 +210,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $found_ids = wp_list_pluck( $found, 'ID' ); - $this->assertEqualSets( array( $posts[0] ), $found_ids ); + $this->assertSameSets( array( $posts[0] ), $found_ids ); } /** @@ -235,7 +235,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $cached_ids = wp_list_pluck( $cached, 'ID' ); - $this->assertEqualSets( $posts, $cached_ids ); + $this->assertSameSets( $posts, $cached_ids ); delete_post_meta_by_key( 'foo' ); @@ -247,7 +247,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { ); $found_ids = wp_list_pluck( $found, 'ID' ); - $this->assertEqualSets( array(), $found_ids ); + $this->assertSameSets( array(), $found_ids ); } /** @@ -340,7 +340,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { 'hierarchical' => false, ) ); - $this->assertEqualSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); $pages = get_pages( array( @@ -348,7 +348,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { 'hierarchical' => false, ) ); - $this->assertEqualSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); $pages = get_pages( array( @@ -356,16 +356,16 @@ class Tests_Post_getPages extends WP_UnitTestCase { 'hierarchical' => false, ) ); - $this->assertEqualSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); $pages = get_pages( array( 'parent' => 0 ) ); - $this->assertEqualSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); $pages = get_pages( array( 'parent' => $page_id1 ) ); - $this->assertEqualSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); $pages = get_pages( array( 'parent' => array( $page_id1, $page_id2 ) ) ); - $this->assertEqualSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); } /** @@ -392,7 +392,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { 'post_parent' => $post_id, ) ); - $this->assertEqualSets( $child_ids, $post_ids ); + $this->assertSameSets( $child_ids, $post_ids ); } /** @@ -442,7 +442,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { * If it doesn't, they will be in the creation order, 1,2,3,4. */ - $this->assertEqualSets( array( $page_1, $page_2, $page_4, $page_3 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_1, $page_2, $page_4, $page_3 ), wp_list_pluck( $pages, 'ID' ) ); } /** @@ -488,7 +488,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { $found_pages = wp_list_filter( $pages, array( 'post_parent' => 0 ) ); - $this->assertEqualSets( array( $page_1, $page_2 ), wp_list_pluck( $found_pages, 'ID' ) ); + $this->assertSameSets( array( $page_1, $page_2 ), wp_list_pluck( $found_pages, 'ID' ) ); } /** @@ -524,7 +524,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { * in order of creation: 1, 2, 3, 4, regardless of parent. */ - $this->assertEqualSets( array( $page_1, $page_2, $page_3, $page_4 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_1, $page_2, $page_3, $page_4 ), wp_list_pluck( $pages, 'ID' ) ); } /** @@ -567,7 +567,7 @@ class Tests_Post_getPages extends WP_UnitTestCase { * hierarchically in order of creation: 3, 4, 5. */ - $this->assertEqualSets( array( $page_3, $page_4, $page_5 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_3, $page_4, $page_5 ), wp_list_pluck( $pages, 'ID' ) ); } /** @@ -614,11 +614,11 @@ class Tests_Post_getPages extends WP_UnitTestCase { * If hierarchical is false, and child_of is not empty, pages will (apparently) be returned * hierarchically anyway in order of creation: 3, 4, 5. */ - $this->assertEqualSets( array( $page_3, $page_4, $page_5 ), wp_list_pluck( $pages, 'ID' ) ); + $this->assertSameSets( array( $page_3, $page_4, $page_5 ), wp_list_pluck( $pages, 'ID' ) ); // How it should work. $found_pages = wp_list_filter( $pages, array( 'post_parent' => $page_1 ) ); - $this->assertEqualSets( array( $page_3, $page_5 ), wp_list_pluck( $found_pages, 'ID' ) ); + $this->assertSameSets( array( $page_3, $page_5 ), wp_list_pluck( $found_pages, 'ID' ) ); } diff --git a/tests/phpunit/tests/post/nav-menu.php b/tests/phpunit/tests/post/nav-menu.php index cc80e85cdf..d74929966f 100644 --- a/tests/phpunit/tests/post/nav-menu.php +++ b/tests/phpunit/tests/post/nav-menu.php @@ -106,35 +106,35 @@ class Test_Nav_Menus extends WP_UnitTestCase { ); $tag_items = wp_get_associated_nav_menu_items( $tag_id, 'taxonomy', 'post_tag' ); - $this->assertEqualSets( array( $tag_insert ), $tag_items ); + $this->assertSameSets( array( $tag_insert ), $tag_items ); $cat_items = wp_get_associated_nav_menu_items( $cat_id, 'taxonomy', 'category' ); - $this->assertEqualSets( array( $cat_insert ), $cat_items ); + $this->assertSameSets( array( $cat_insert ), $cat_items ); $post_items = wp_get_associated_nav_menu_items( $post_id ); - $this->assertEqualSets( array( $post_insert ), $post_items ); + $this->assertSameSets( array( $post_insert ), $post_items ); $post_2_items = wp_get_associated_nav_menu_items( $post_2_id ); - $this->assertEqualSets( array( $post_2_insert ), $post_2_items ); + $this->assertSameSets( array( $post_2_insert ), $post_2_items ); $page_items = wp_get_associated_nav_menu_items( $page_id ); - $this->assertEqualSets( array( $page_insert ), $page_items ); + $this->assertSameSets( array( $page_insert ), $page_items ); wp_delete_term( $tag_id, 'post_tag' ); $tag_items = wp_get_associated_nav_menu_items( $tag_id, 'taxonomy', 'post_tag' ); - $this->assertEqualSets( array(), $tag_items ); + $this->assertSameSets( array(), $tag_items ); wp_delete_term( $cat_id, 'category' ); $cat_items = wp_get_associated_nav_menu_items( $cat_id, 'taxonomy', 'category' ); - $this->assertEqualSets( array(), $cat_items ); + $this->assertSameSets( array(), $cat_items ); wp_delete_post( $post_id, true ); $post_items = wp_get_associated_nav_menu_items( $post_id ); - $this->assertEqualSets( array(), $post_items ); + $this->assertSameSets( array(), $post_items ); wp_delete_post( $post_2_id, true ); $post_2_items = wp_get_associated_nav_menu_items( $post_2_id ); - $this->assertEqualSets( array(), $post_2_items ); + $this->assertSameSets( array(), $post_2_items ); wp_delete_post( $page_id, true ); $page_items = wp_get_associated_nav_menu_items( $page_id ); - $this->assertEqualSets( array(), $page_items ); + $this->assertSameSets( array(), $page_items ); } /** diff --git a/tests/phpunit/tests/post/query.php b/tests/phpunit/tests/post/query.php index 46e0ec38cf..1c6e30faf9 100644 --- a/tests/phpunit/tests/post/query.php +++ b/tests/phpunit/tests/post/query.php @@ -519,7 +519,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ); $actual_posts = $q->get_posts(); - $this->assertEqualSets( $requested, $actual_posts ); + $this->assertSameSets( $requested, $actual_posts ); $requested = array( $post_ids[1], $post_ids[2] ); $q->query( @@ -529,7 +529,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ); $actual_posts = $q->get_posts(); - $this->assertEqualSets( $requested, $actual_posts ); + $this->assertSameSets( $requested, $actual_posts ); } /** diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php index f526d60227..9090f865c9 100644 --- a/tests/phpunit/tests/post/types.php +++ b/tests/phpunit/tests/post/types.php @@ -413,7 +413,7 @@ class Tests_Post_Types extends WP_UnitTestCase { ) ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'editor' => true, 'author' => true, @@ -563,13 +563,13 @@ class Tests_Post_Types extends WP_UnitTestCase { * @ticket 34010 */ public function test_get_post_types_by_support_excluding_features() { - $this->assertEqualSets( array(), get_post_types_by_support( array( 'post-formats', 'page-attributes' ) ) ); + $this->assertSameSets( array(), get_post_types_by_support( array( 'post-formats', 'page-attributes' ) ) ); } /** * @ticket 34010 */ public function test_get_post_types_by_support_non_existant_feature() { - $this->assertEqualSets( array(), get_post_types_by_support( 'somefeature' ) ); + $this->assertSameSets( array(), get_post_types_by_support( 'somefeature' ) ); } } diff --git a/tests/phpunit/tests/post/wpPostType.php b/tests/phpunit/tests/post/wpPostType.php index 041d1320c2..2cbc624c74 100644 --- a/tests/phpunit/tests/post/wpPostType.php +++ b/tests/phpunit/tests/post/wpPostType.php @@ -22,14 +22,14 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { $post_type_object->remove_supports(); $post_type_supports_after = get_all_post_type_supports( $post_type ); - $this->assertEqualSets( + $this->assertSameSets( array( 'title' => true, 'editor' => true, ), $post_type_supports ); - $this->assertEqualSets( array(), $post_type_supports_after ); + $this->assertSameSets( array(), $post_type_supports_after ); } public function test_add_supports_custom() { @@ -51,7 +51,7 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { $post_type_object->remove_supports(); $post_type_supports_after = get_all_post_type_supports( $post_type ); - $this->assertEqualSets( + $this->assertSameSets( array( 'editor' => true, 'comments' => true, @@ -59,7 +59,7 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { ), $post_type_supports ); - $this->assertEqualSets( array(), $post_type_supports_after ); + $this->assertSameSets( array(), $post_type_supports_after ); } /** @@ -88,7 +88,7 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { $post_type_object->remove_supports(); $post_type_supports_after = get_all_post_type_supports( $post_type ); - $this->assertEqualSets( + $this->assertSameSets( array( 'support_with_args' => array( array( @@ -100,7 +100,7 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { ), $post_type_supports ); - $this->assertEqualSets( array(), $post_type_supports_after ); + $this->assertSameSets( array(), $post_type_supports_after ); } public function test_does_not_add_query_var_if_not_public() { @@ -213,7 +213,7 @@ class Tests_WP_Post_Type extends WP_UnitTestCase { unset( $wp_post_types[ $post_type ] ); - $this->assertEqualSets( array( 'post_tag' ), $taxonomies ); - $this->assertEqualSets( array(), $taxonomies_after ); + $this->assertSameSets( array( 'post_tag' ), $taxonomies ); + $this->assertSameSets( array(), $taxonomies_after ); } } diff --git a/tests/phpunit/tests/query.php b/tests/phpunit/tests/query.php index 135e5536c7..a13783a95d 100644 --- a/tests/phpunit/tests/query.php +++ b/tests/phpunit/tests/query.php @@ -190,7 +190,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2 ), $matching_posts ); } public function test_category_querystring_multiple_terms_comma_separated() { @@ -234,7 +234,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2, $p3 ), $matching_posts ); } /** @@ -281,7 +281,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2, $p3 ), $matching_posts ); } @@ -318,7 +318,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2 ), $matching_posts ); } public function test_tag_querystring_multiple_terms_comma_separated() { @@ -362,7 +362,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2, $p3 ), $matching_posts ); } /** @@ -409,7 +409,7 @@ class Tests_Query extends WP_UnitTestCase { $matching_posts = wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), $matching_posts ); + $this->assertSameSets( array( $p1, $p2, $p3 ), $matching_posts ); } public function test_custom_taxonomy_querystring_single_term() { @@ -436,7 +436,7 @@ class Tests_Query extends WP_UnitTestCase { $this->go_to( $url ); - $this->assertEqualSets( array( $p1, $p2 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); + $this->assertSameSets( array( $p1, $p2 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); } public function test_custom_taxonomy_querystring_multiple_terms_comma_separated() { @@ -465,7 +465,7 @@ class Tests_Query extends WP_UnitTestCase { $this->go_to( $url ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); + $this->assertSameSets( array( $p1, $p2, $p3 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); } /** @@ -497,7 +497,7 @@ class Tests_Query extends WP_UnitTestCase { $this->go_to( $url ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); + $this->assertSameSets( array( $p1, $p2, $p3 ), wp_list_pluck( $GLOBALS['wp_query']->posts, 'ID' ) ); } /** diff --git a/tests/phpunit/tests/query/commentCount.php b/tests/phpunit/tests/query/commentCount.php index 4f5f3f2572..fd72740f7b 100644 --- a/tests/phpunit/tests/query/commentCount.php +++ b/tests/phpunit/tests/query/commentCount.php @@ -81,7 +81,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = self::$post_ids[4]; - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_greater_than() { @@ -99,7 +99,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = self::$post_ids[5]; - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_greater_than_no_results() { @@ -117,7 +117,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = array(); - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_less_than() { $args = array( @@ -143,7 +143,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_less_than_no_results() { @@ -161,7 +161,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = array(); - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } @@ -189,7 +189,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_equal_or_greater_than() { @@ -213,7 +213,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_equal_or_greater_than_no_results() { @@ -231,7 +231,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = array(); - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_equal_or_less_than() { @@ -255,7 +255,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_operator_equal_or_less_than_no_results() { @@ -273,7 +273,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = array(); - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_invalid_operator_should_fall_back_on_equals() { @@ -294,7 +294,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_wrong_count_no_results() { @@ -312,7 +312,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = array(); - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_no_operator_no_results() { @@ -329,7 +329,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = self::$post_ids[5]; - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_empty_non_numeric_string_should_be_ignored() { @@ -353,7 +353,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected[] = $expected_id; } - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } public function test_simple_count() { @@ -368,7 +368,7 @@ class Tests_Query_CommentCount extends WP_UnitTestCase { $expected = self::$post_ids[5]; - $this->assertEqualSets( $found_post_ids, $expected ); + $this->assertSameSets( $found_post_ids, $expected ); } } diff --git a/tests/phpunit/tests/query/dateQuery.php b/tests/phpunit/tests/query/dateQuery.php index bde99c9041..8b97afd17e 100644 --- a/tests/phpunit/tests/query/dateQuery.php +++ b/tests/phpunit/tests/query/dateQuery.php @@ -54,7 +54,7 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), wp_list_pluck( $posts, 'ID' ) ); + $this->assertSameSets( array( $p1, $p2 ), wp_list_pluck( $posts, 'ID' ) ); } /** @@ -77,7 +77,7 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1 ), wp_list_pluck( $posts, 'ID' ) ); + $this->assertSameSets( array( $p1 ), wp_list_pluck( $posts, 'ID' ) ); } public function test_date_query_before_string() { @@ -118,7 +118,7 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p3 ), wp_list_pluck( $posts, 'ID' ) ); + $this->assertSameSets( array( $p3 ), wp_list_pluck( $posts, 'ID' ) ); } /** @@ -290,8 +290,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $before_posts ); - $this->assertEqualSets( array( $p1, $p2 ), $after_posts ); + $this->assertSameSets( array( $p1, $p2 ), $before_posts ); + $this->assertSameSets( array( $p1, $p2 ), $after_posts ); } /** @@ -374,8 +374,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $before_posts ); - $this->assertEqualSets( array( $p1, $p2 ), $after_posts ); + $this->assertSameSets( array( $p1, $p2 ), $before_posts ); + $this->assertSameSets( array( $p1, $p2 ), $after_posts ); } /** @@ -458,8 +458,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $before_posts ); - $this->assertEqualSets( array( $p1, $p2 ), $after_posts ); + $this->assertSameSets( array( $p1, $p2 ), $before_posts ); + $this->assertSameSets( array( $p1, $p2 ), $after_posts ); } /** @@ -542,8 +542,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $before_posts ); - $this->assertEqualSets( array( $p1, $p2 ), $after_posts ); + $this->assertSameSets( array( $p1, $p2 ), $before_posts ); + $this->assertSameSets( array( $p1, $p2 ), $after_posts ); } /** @@ -626,8 +626,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $before_posts ); - $this->assertEqualSets( array( $p1, $p2 ), $after_posts ); + $this->assertSameSets( array( $p1, $p2 ), $before_posts ); + $this->assertSameSets( array( $p1, $p2 ), $after_posts ); } /** @@ -867,7 +867,7 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) ); + $this->assertSameSets( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) ); } public function test_date_query_relation_or() { @@ -1084,7 +1084,7 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { $expected = array( $p1, $p2 ); - $this->assertEqualSets( $expected, $q->posts ); + $this->assertSameSets( $expected, $q->posts ); } /** @@ -1163,6 +1163,6 @@ class Tests_Query_DateQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p4, $p5 ); - $this->assertEqualSets( $expected, $q->posts ); + $this->assertSameSets( $expected, $q->posts ); } } diff --git a/tests/phpunit/tests/query/metaQuery.php b/tests/phpunit/tests/query/metaQuery.php index a1a155c369..5acec55d3f 100644 --- a/tests/phpunit/tests/query/metaQuery.php +++ b/tests/phpunit/tests/query/metaQuery.php @@ -28,7 +28,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_no_value() { @@ -54,7 +54,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2, $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_default() { @@ -78,7 +78,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_equals() { @@ -103,7 +103,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_not_equals() { @@ -130,7 +130,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_arithmetic_comparisons() { @@ -159,7 +159,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); // <= $query = new WP_Query( @@ -178,7 +178,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); // >= $query = new WP_Query( @@ -197,7 +197,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2, $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); // > $query = new WP_Query( @@ -216,7 +216,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_like() { @@ -241,7 +241,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_not_like() { @@ -268,7 +268,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_between_not_between() { @@ -297,7 +297,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); $query = new WP_Query( array( @@ -316,7 +316,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_regexp_rlike() { @@ -342,7 +342,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); // RLIKE is a synonym for REGEXP. $query = new WP_Query( @@ -361,7 +361,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p2 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_single_query_compare_not_regexp() { @@ -387,7 +387,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_relation_default() { @@ -467,7 +467,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $post_id, $post_id2, $post_id3, $post_id4 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_query_relation_and() { @@ -523,7 +523,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $post_id7 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); $query = new WP_Query( array( @@ -543,7 +543,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $post_id2, $post_id6, $post_id7 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -566,7 +566,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $query->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $query->posts ); } /** @@ -590,7 +590,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[2] ), $query->posts ); + $this->assertSameSets( array( $posts[2] ), $query->posts ); } /** @@ -614,7 +614,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[1] ), $query->posts ); + $this->assertSameSets( array( $posts[1] ), $query->posts ); } /** @@ -651,7 +651,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $post_id2, $post_id3, $post_id4 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); $query = new WP_Query( array( @@ -734,7 +734,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[1], $posts[2], $posts[3] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -769,7 +769,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[1], $posts[2] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -804,7 +804,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[0], $posts[1] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -839,7 +839,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[0], $posts[1] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -874,7 +874,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[1], $posts[2] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -910,7 +910,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[0], $posts[2] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -947,7 +947,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[3] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -984,7 +984,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[1] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1020,7 +1020,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[3] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1063,7 +1063,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[2] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1099,7 +1099,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[3] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1135,7 +1135,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $posts[3] ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1167,7 +1167,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_3 ), $query->posts ); + $this->assertSameSets( array( $post_3 ), $query->posts ); $query = new WP_Query( array( @@ -1184,7 +1184,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_4 ), $query->posts ); + $this->assertSameSets( array( $post_4 ), $query->posts ); $query = new WP_Query( array( @@ -1201,7 +1201,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_3, $post_4 ), $query->posts ); + $this->assertSameSets( array( $post_3, $post_4 ), $query->posts ); $query = new WP_Query( array( @@ -1218,7 +1218,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_1 ), $query->posts, 'ID' ); + $this->assertSameSets( array( $post_1 ), $query->posts, 'ID' ); $query = new WP_Query( array( @@ -1235,7 +1235,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_1, $post_2, $post_3 ), $query->posts ); + $this->assertSameSets( array( $post_1, $post_2, $post_3 ), $query->posts ); $query = new WP_Query( array( @@ -1252,7 +1252,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_3 ), $query->posts ); + $this->assertSameSets( array( $post_3 ), $query->posts ); $query = new WP_Query( array( @@ -1269,7 +1269,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_1, $post_2, $post_4 ), $query->posts ); + $this->assertSameSets( array( $post_1, $post_2, $post_4 ), $query->posts ); $query = new WP_Query( array( @@ -1286,7 +1286,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_1, $post_3 ), $query->posts ); + $this->assertSameSets( array( $post_1, $post_3 ), $query->posts ); $query = new WP_Query( array( @@ -1303,7 +1303,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_2, $post_4 ), $query->posts ); + $this->assertSameSets( array( $post_2, $post_4 ), $query->posts ); $query = new WP_Query( array( @@ -1316,7 +1316,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $post_4, $post_3, $post_2, $post_1 ), $query->posts ); + $this->assertSameSets( array( $post_4, $post_3, $post_2, $post_1 ), $query->posts ); } public function test_meta_vars_should_be_converted_to_meta_query() { @@ -1461,7 +1461,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } /** @@ -1511,7 +1511,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ); $expected = array( $p1, $p3 ); - $this->assertEqualSets( $expected, $query->posts ); + $this->assertSameSets( $expected, $query->posts ); } public function test_meta_between_not_between() { @@ -1540,7 +1540,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $query->posts, 'ID' ); - $this->assertEqualSets( array( $post_id2, $post_id3 ), $posts ); + $this->assertSameSets( array( $post_id2, $post_id3 ), $posts ); $args = array( 'meta_key' => 'time', @@ -1556,7 +1556,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $query->posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id4, $post_id5 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id4, $post_id5 ), $posts ); } /** @@ -1584,7 +1584,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 2, count( $posts ) ); $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id3 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id3 ), $posts ); $posts = get_posts( array( @@ -1600,7 +1600,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id3 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id3 ), $posts ); } /** @@ -1631,7 +1631,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id2 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id2 ), $posts ); } /** @@ -1678,7 +1678,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id5 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id5 ), $posts ); $posts = get_posts( array( @@ -1692,7 +1692,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id5 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id5 ), $posts ); $posts = get_posts( array( 'meta_value' => 0 ) ); $this->assertSame( 5, count( $posts ) ); @@ -1701,7 +1701,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); $posts = get_posts( array( 'meta_value' => '0' ) ); $this->assertSame( 5, count( $posts ) ); @@ -1710,7 +1710,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { $this->assertSame( 'raw', $post->filter ); } $posts = wp_list_pluck( $posts, 'ID' ); - $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); + $this->assertSameSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); } /** @@ -1846,7 +1846,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( 'foo_key', 'foo_key-1', 'foo_key-2' ), array_keys( $q->meta_query->get_clauses() ) ); + $this->assertSameSets( array( 'foo_key', 'foo_key-1', 'foo_key-2' ), array_keys( $q->meta_query->get_clauses() ) ); } /** @@ -1871,7 +1871,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); } /** @@ -1892,7 +1892,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); } /** @@ -1919,7 +1919,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0] ), $q->posts ); + $this->assertSameSets( array( $posts[0] ), $q->posts ); } @@ -1947,7 +1947,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[1] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[1] ), $q->posts ); } /** @@ -1974,7 +1974,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); } /** @@ -1999,7 +1999,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[1], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[1], $posts[2] ), $q->posts ); } /** @@ -2026,7 +2026,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[1] ), $q->posts ); + $this->assertSameSets( array( $posts[1] ), $q->posts ); } /** @@ -2053,7 +2053,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[1] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[1] ), $q->posts ); } /** @@ -2080,7 +2080,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[2] ), $q->posts ); } /** @@ -2106,7 +2106,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); $q = new WP_Query( array( @@ -2121,7 +2121,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[0] ), $q->posts ); + $this->assertSameSets( array( $posts[0] ), $q->posts ); } /** @@ -2148,7 +2148,7 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[1] ), $q->posts ); + $this->assertSameSets( array( $posts[1] ), $q->posts ); $q = new WP_Query( array( @@ -2163,6 +2163,6 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $posts[1], $posts[2] ), $q->posts ); + $this->assertSameSets( array( $posts[1], $posts[2] ), $q->posts ); } } diff --git a/tests/phpunit/tests/query/postStatus.php b/tests/phpunit/tests/query/postStatus.php index 624fb469ea..c0be8b01e4 100644 --- a/tests/phpunit/tests/query/postStatus.php +++ b/tests/phpunit/tests/query/postStatus.php @@ -82,7 +82,7 @@ class Tests_Query_PostStatus extends WP_UnitTestCase { self::$author_private_post, ); - $this->assertEqualSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); } public function test_private_should_not_be_included_for_non_author_if_perm_is_not_false() { @@ -112,7 +112,7 @@ class Tests_Query_PostStatus extends WP_UnitTestCase { self::$author_private_post, ); - $this->assertEqualSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); } public function test_private_should_be_included_for_all_users_if_perm_is_readable_and_user_can_read_others_posts() { @@ -130,7 +130,7 @@ class Tests_Query_PostStatus extends WP_UnitTestCase { self::$editor_private_post, ); - $this->assertEqualSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); } public function test_private_should_be_included_only_for_current_user_if_perm_is_editable_and_user_cannot_read_others_posts() { @@ -147,7 +147,7 @@ class Tests_Query_PostStatus extends WP_UnitTestCase { self::$author_private_post, ); - $this->assertEqualSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); } public function test_private_should_be_included_for_all_users_if_perm_is_editable_and_user_can_read_others_posts() { @@ -165,7 +165,7 @@ class Tests_Query_PostStatus extends WP_UnitTestCase { self::$editor_private_post, ); - $this->assertEqualSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $q->posts, 'ID' ) ); } public function test_all_public_post_stati_should_be_included_when_no_post_status_is_provided() { diff --git a/tests/phpunit/tests/query/search.php b/tests/phpunit/tests/query/search.php index 0b26ad0257..c1c74c8240 100644 --- a/tests/phpunit/tests/query/search.php +++ b/tests/phpunit/tests/query/search.php @@ -153,7 +153,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** @@ -180,7 +180,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** @@ -213,7 +213,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p3 ), $q->posts ); + $this->assertSameSets( array( $p3 ), $q->posts ); } /** @@ -246,7 +246,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p3 ), $q->posts ); + $this->assertSameSets( array( $p1, $p3 ), $q->posts ); } /** @@ -292,7 +292,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** @@ -345,7 +345,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p3 ), $q->posts ); + $this->assertSameSets( array( $p1, $p3 ), $q->posts ); $q = new WP_Query( array( @@ -354,7 +354,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); $q = new WP_Query( array( @@ -363,7 +363,7 @@ class Tests_Query_Search extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** diff --git a/tests/phpunit/tests/query/taxQuery.php b/tests/phpunit/tests/query/taxQuery.php index 0f3ca06eda..0fe8a3ee77 100644 --- a/tests/phpunit/tests/query/taxQuery.php +++ b/tests/phpunit/tests/query/taxQuery.php @@ -297,7 +297,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); } public function test_tax_query_single_query_multiple_terms_operator_not_in() { @@ -464,7 +464,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p3 ), $q->posts ); + $this->assertSameSets( array( $p1, $p3 ), $q->posts ); } /** @@ -511,7 +511,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { unregister_taxonomy( 'wptests_tax1' ); unregister_taxonomy( 'wptests_tax2' ); - $this->assertEqualSets( array( $p1, $p3, $p4 ), $q->posts ); + $this->assertSameSets( array( $p1, $p3, $p4 ), $q->posts ); } /** @@ -545,7 +545,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** @@ -580,7 +580,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2 ), $q->posts ); + $this->assertSameSets( array( $p2 ), $q->posts ); } /** @@ -705,7 +705,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); } public function test_tax_query_multiple_queries_different_taxonomies() { @@ -751,7 +751,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); } /** @@ -833,7 +833,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { _unregister_taxonomy( 'foo' ); _unregister_taxonomy( 'bar' ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); } /** @@ -907,7 +907,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { _unregister_taxonomy( 'foo' ); _unregister_taxonomy( 'bar' ); - $this->assertEqualSets( array( $p1, $p2 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2 ), $q->posts ); } /** @@ -990,7 +990,7 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { _unregister_taxonomy( 'foo' ); _unregister_taxonomy( 'bar' ); - $this->assertEqualSets( array( $p1, $p2, $p3 ), $q->posts ); + $this->assertSameSets( array( $p1, $p2, $p3 ), $q->posts ); } /** @@ -1621,6 +1621,6 @@ class Tests_Query_TaxQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p ), $q->posts ); + $this->assertSameSets( array( $p ), $q->posts ); } } diff --git a/tests/phpunit/tests/rest-api/rest-attachments-controller.php b/tests/phpunit/tests/rest-api/rest-attachments-controller.php index c98df2b954..571337f6d4 100644 --- a/tests/phpunit/tests/rest-api/rest-attachments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-attachments-controller.php @@ -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() { diff --git a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php index 588972801d..e5ec08f66e 100644 --- a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php +++ b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php @@ -141,14 +141,14 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/autosaves/' . self::$autosave_post_id ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_registered_query_params() { @@ -225,7 +225,7 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle 'excerpt', 'content', ); - $this->assertEqualSets( $fields, array_keys( $data ) ); + $this->assertSameSets( $fields, array_keys( $data ) ); $this->assertSame( self::$editor_id, $data['author'] ); } @@ -244,7 +244,7 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle 'excerpt', ); $data = $response->get_data(); - $this->assertEqualSets( $fields, array_keys( $data ) ); + $this->assertSameSets( $fields, array_keys( $data ) ); } public function test_get_item_no_permission() { diff --git a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php index ee2b37408f..0e8dddc25a 100644 --- a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php @@ -596,8 +596,8 @@ class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEqualSets( array( 'GET', 'POST' ), $data['endpoints'][0]['methods'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'GET', 'POST' ), $data['endpoints'][0]['methods'] ); + $this->assertSameSets( array( 'name', 'context', 'attributes', 'post_id' ), array_keys( $data['endpoints'][0]['args'] ) ); diff --git a/tests/phpunit/tests/rest-api/rest-block-type-controller.php b/tests/phpunit/tests/rest-api/rest-block-type-controller.php index bfe98454c5..272709e008 100644 --- a/tests/phpunit/tests/rest-api/rest-block-type-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-type-controller.php @@ -143,7 +143,7 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'GET', '/wp/v2/block-types/' . $block_name ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEqualSets( array( $block_styles ), $data['styles'] ); + $this->assertSameSets( array( $block_styles ), $data['styles'] ); } @@ -184,7 +184,7 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase { 'style_handle' => 'myguten-style', ), ); - $this->assertEqualSets( $expected, $data['styles'] ); + $this->assertSameSets( $expected, $data['styles'] ); } @@ -238,13 +238,13 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase { $this->assertNull( $data['script'] ); $this->assertNull( $data['editor_style'] ); $this->assertNull( $data['style'] ); - $this->assertEqualSets( array(), $data['provides_context'] ); - $this->assertEqualSets( array(), $data['attributes'] ); - $this->assertEqualSets( array( 'invalid_uses_context' ), $data['uses_context'] ); - $this->assertEqualSets( array( 'invalid_keywords' ), $data['keywords'] ); - $this->assertEqualSets( array( 'invalid_parent' ), $data['parent'] ); - $this->assertEqualSets( array(), $data['supports'] ); - $this->assertEqualSets( array(), $data['styles'] ); + $this->assertSameSets( array(), $data['provides_context'] ); + $this->assertSameSets( array(), $data['attributes'] ); + $this->assertSameSets( array( 'invalid_uses_context' ), $data['uses_context'] ); + $this->assertSameSets( array( 'invalid_keywords' ), $data['keywords'] ); + $this->assertSameSets( array( 'invalid_parent' ), $data['parent'] ); + $this->assertSameSets( array(), $data['supports'] ); + $this->assertSameSets( array(), $data['styles'] ); $this->assertNull( $data['example'] ); $this->assertNull( $data['category'] ); $this->assertNull( $data['textdomain'] ); @@ -289,13 +289,13 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase { $this->assertNull( $data['script'] ); $this->assertNull( $data['editor_style'] ); $this->assertNull( $data['style'] ); - $this->assertEqualSets( array(), $data['attributes'] ); - $this->assertEqualSets( array(), $data['provides_context'] ); - $this->assertEqualSets( array(), $data['uses_context'] ); - $this->assertEqualSets( array(), $data['keywords'] ); - $this->assertEqualSets( array(), $data['parent'] ); - $this->assertEqualSets( array(), $data['supports'] ); - $this->assertEqualSets( array(), $data['styles'] ); + $this->assertSameSets( array(), $data['attributes'] ); + $this->assertSameSets( array(), $data['provides_context'] ); + $this->assertSameSets( array(), $data['uses_context'] ); + $this->assertSameSets( array(), $data['keywords'] ); + $this->assertSameSets( array(), $data['parent'] ); + $this->assertSameSets( array(), $data['supports'] ); + $this->assertSameSets( array(), $data['styles'] ); $this->assertNull( $data['example'] ); $this->assertNull( $data['category'] ); $this->assertNull( $data['example'] ); diff --git a/tests/phpunit/tests/rest-api/rest-categories-controller.php b/tests/phpunit/tests/rest-api/rest-categories-controller.php index de87f8d29c..2899602451 100644 --- a/tests/phpunit/tests/rest-api/rest-categories-controller.php +++ b/tests/phpunit/tests/rest-api/rest-categories-controller.php @@ -118,14 +118,14 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $category1 = $this->factory->category->create( array( 'name' => 'Season 5' ) ); $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories/' . $category1 ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_registered_query_params() { @@ -1229,7 +1229,7 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas $relations[] = 'up'; } - $this->assertEqualSets( $relations, array_keys( $links ) ); + $this->assertSameSets( $relations, array_keys( $links ) ); $this->assertContains( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] ); $this->assertSame( add_query_arg( 'categories', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] ); } diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index b65d4eb259..9d35a747f9 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -3245,7 +3245,7 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase $this->assertSame( mysql_to_rfc3339( $comment->comment_date_gmt ), $data['date_gmt'] ); $this->assertSame( get_comment_link( $comment ), $data['link'] ); $this->assertContains( 'author_avatar_urls', $data ); - $this->assertEqualSets( + $this->assertSameSets( array( 'self', 'collection', diff --git a/tests/phpunit/tests/rest-api/rest-controller.php b/tests/phpunit/tests/rest-api/rest-controller.php index 30853392b6..a1a1d322ec 100644 --- a/tests/phpunit/tests/rest-api/rest-controller.php +++ b/tests/phpunit/tests/rest-api/rest-controller.php @@ -456,7 +456,7 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase { $this->assertArrayNotHasKey( 'properties', $controller->get_public_item_schema() ); // Test that the schema lacking 'properties' is returned as expected. - $this->assertEqualSetsWithIndex( $controller->get_public_item_schema(), $controller->get_test_schema() ); + $this->assertSameSetsWithIndex( $controller->get_public_item_schema(), $controller->get_test_schema() ); } public function test_add_additional_fields_to_object_respects_fields_param() { diff --git a/tests/phpunit/tests/rest-api/rest-pages-controller.php b/tests/phpunit/tests/rest-api/rest-pages-controller.php index e98dfe8a75..768a0f03b6 100644 --- a/tests/phpunit/tests/rest-api/rest-pages-controller.php +++ b/tests/phpunit/tests/rest-api/rest-pages-controller.php @@ -184,7 +184,7 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 2, count( $data ) ); - $this->assertEqualSets( array( $id2, $id4 ), wp_list_pluck( $data, 'id' ) ); + $this->assertSameSets( array( $id2, $id4 ), wp_list_pluck( $data, 'id' ) ); } public function test_get_items_parent_exclude_query() { @@ -254,13 +254,13 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $request = new WP_REST_Request( 'GET', '/wp/v2/pages' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEqualSets( array( $id1, $id2, $id3, $id4 ), wp_list_pluck( $data, 'id' ) ); + $this->assertSameSets( array( $id1, $id2, $id3, $id4 ), wp_list_pluck( $data, 'id' ) ); // Filter to 'menu_order'. $request->set_param( 'menu_order', 1 ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEqualSets( array( $id4 ), wp_list_pluck( $data, 'id' ) ); + $this->assertSameSets( array( $id4 ), wp_list_pluck( $data, 'id' ) ); // Order by 'menu order'. $request = new WP_REST_Request( 'GET', '/wp/v2/pages' ); diff --git a/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php b/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php index fbd3383258..76ff41fe6b 100644 --- a/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php +++ b/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php @@ -23,13 +23,13 @@ class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Test $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/statuses/publish' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_get_items() { @@ -51,7 +51,7 @@ class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Test $data = $response->get_data(); $this->assertSame( 6, count( $data ) ); - $this->assertEqualSets( + $this->assertSameSets( array( 'publish', 'private', @@ -212,7 +212,7 @@ class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Test $this->assertSame( $status_obj->publicly_queryable, $data['queryable'] ); $this->assertSame( $status_obj->show_in_admin_all_list, $data['show_in_list'] ); $this->assertSame( $status_obj->name, $data['slug'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'archives', ), diff --git a/tests/phpunit/tests/rest-api/rest-post-types-controller.php b/tests/phpunit/tests/rest-api/rest-post-types-controller.php index 727aa00d88..bc99650c25 100644 --- a/tests/phpunit/tests/rest-api/rest-post-types-controller.php +++ b/tests/phpunit/tests/rest-api/rest-post-types-controller.php @@ -23,13 +23,13 @@ class WP_Test_REST_Post_Types_Controller extends WP_Test_REST_Controller_Testcas $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/types/post' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_get_items() { diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index a565fce6b3..1e84b14844 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -275,7 +275,7 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertSame( 200, $response->get_status() ); $data = $response->get_data(); $this->assertSame( 2, count( $data ) ); - $this->assertEqualSets( array( self::$editor_id, self::$author_id ), wp_list_pluck( $data, 'author' ) ); + $this->assertSameSets( array( self::$editor_id, self::$author_id ), wp_list_pluck( $data, 'author' ) ); // Limit to editor. $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); diff --git a/tests/phpunit/tests/rest-api/rest-request.php b/tests/phpunit/tests/rest-api/rest-request.php index bf3d65ea3c..7ad78d81aa 100644 --- a/tests/phpunit/tests/rest-api/rest-request.php +++ b/tests/phpunit/tests/rest-api/rest-request.php @@ -598,7 +598,7 @@ class Tests_REST_Request extends WP_UnitTestCase { $request = WP_REST_Request::from_url( $url ); $this->assertInstanceOf( 'WP_REST_Request', $request ); $this->assertSame( '/wp/v2/posts/1', $request->get_route() ); - $this->assertEqualSets( + $this->assertSameSets( array( 'foo' => 'bar', ), diff --git a/tests/phpunit/tests/rest-api/rest-revisions-controller.php b/tests/phpunit/tests/rest-api/rest-revisions-controller.php index f138662393..8a7ad9fbfa 100644 --- a/tests/phpunit/tests/rest-api/rest-revisions-controller.php +++ b/tests/phpunit/tests/rest-api/rest-revisions-controller.php @@ -111,13 +111,13 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_1->ID ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_get_items() { @@ -185,7 +185,7 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase 'content', ); $data = $response->get_data(); - $this->assertEqualSets( $fields, array_keys( $data ) ); + $this->assertSameSets( $fields, array_keys( $data ) ); $this->assertSame( self::$editor_id, $data['author'] ); } @@ -204,7 +204,7 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase 'excerpt', ); $data = $response->get_data(); - $this->assertEqualSets( $fields, array_keys( $data ) ); + $this->assertSameSets( $fields, array_keys( $data ) ); } public function test_get_item_no_permission() { diff --git a/tests/phpunit/tests/rest-api/rest-search-controller.php b/tests/phpunit/tests/rest-api/rest-search-controller.php index a7c177676f..491196c4a4 100644 --- a/tests/phpunit/tests/rest-api/rest-search-controller.php +++ b/tests/phpunit/tests/rest-api/rest-search-controller.php @@ -111,7 +111,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( array_merge( self::$my_title_post_ids, self::$my_title_page_ids, @@ -147,7 +147,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( array_merge( self::$my_title_post_ids, self::$my_title_page_ids, @@ -170,7 +170,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( array_merge( self::$my_title_post_ids, self::$my_content_post_ids @@ -192,7 +192,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( self::$my_title_page_ids, wp_list_pluck( $response->get_data(), 'id' ) ); @@ -240,7 +240,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( array_merge( self::$my_title_post_ids, self::$my_title_page_ids, @@ -262,7 +262,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( array_merge( self::$my_title_post_ids, self::$my_title_page_ids @@ -283,7 +283,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ); $this->assertSame( 200, $response->get_status() ); - $this->assertEqualSets( + $this->assertSameSets( self::$my_content_post_ids, wp_list_pluck( $response->get_data(), 'id' ) ); @@ -420,7 +420,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ) ); $response = $controller->get_items( $request ); - $this->assertEqualSets( range( 1, 10 ), wp_list_pluck( $response->get_data(), 'id' ) ); + $this->assertSameSets( range( 1, 10 ), wp_list_pluck( $response->get_data(), 'id' ) ); $request = $this->get_request( array( @@ -431,7 +431,7 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { ) ); $response = $controller->get_items( $request ); - $this->assertEqualSets( range( 1, 5 ), wp_list_pluck( $response->get_data(), 'id' ) ); + $this->assertSameSets( range( 1, 5 ), wp_list_pluck( $response->get_data(), 'id' ) ); } /** @@ -496,8 +496,8 @@ class WP_Test_REST_Search_Controller extends WP_Test_REST_Controller_Testcase { $params = $controller->get_collection_params(); $this->assertSame( 'test', $params[ WP_REST_Search_Controller::PROP_TYPE ]['default'] ); - $this->assertEqualSets( array( 'test' ), $params[ WP_REST_Search_Controller::PROP_TYPE ]['enum'] ); - $this->assertEqualSets( array( 'test_first_type', 'test_second_type', WP_REST_Search_Controller::TYPE_ANY ), $params[ WP_REST_Search_Controller::PROP_SUBTYPE ]['items']['enum'] ); + $this->assertSameSets( array( 'test' ), $params[ WP_REST_Search_Controller::PROP_TYPE ]['enum'] ); + $this->assertSameSets( array( 'test_first_type', 'test_second_type', WP_REST_Search_Controller::TYPE_ANY ), $params[ WP_REST_Search_Controller::PROP_SUBTYPE ]['items']['enum'] ); } /** diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index decf35d7a4..94d0f0c6df 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -872,7 +872,7 @@ class Tests_REST_Server extends WP_Test_REST_TestCase { if ( false === $expected ) { $this->assertArrayNotHasKey( '_embedded', $data ); } else { - $this->assertEqualSets( $expected, array_keys( $data['_embedded'] ) ); + $this->assertSameSets( $expected, array_keys( $data['_embedded'] ) ); } } diff --git a/tests/phpunit/tests/rest-api/rest-tags-controller.php b/tests/phpunit/tests/rest-api/rest-tags-controller.php index bec6ce3070..bae98da827 100644 --- a/tests/phpunit/tests/rest-api/rest-tags-controller.php +++ b/tests/phpunit/tests/rest-api/rest-tags-controller.php @@ -136,14 +136,14 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $tag1 = $this->factory->tag->create( array( 'name' => 'Season 5' ) ); $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/tags/' . $tag1 ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_registered_query_params() { @@ -1342,7 +1342,7 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $found_2 = wp_list_pluck( $response->data, 'id' ); - $this->assertEqualSets( $found_1, $found_2 ); + $this->assertSameSets( $found_1, $found_2 ); $this->assertSame( $num_queries, $wpdb->num_queries ); } @@ -1444,7 +1444,7 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase { if ( $taxonomy->hierarchical && $term->parent ) { $expected_links[] = 'up'; } - $this->assertEqualSets( $expected_links, array_keys( $links ) ); + $this->assertSameSets( $expected_links, array_keys( $links ) ); $this->assertContains( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] ); $this->assertSame( add_query_arg( 'tags', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] ); } diff --git a/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php b/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php index d0a3509a02..14c3c955d8 100644 --- a/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php +++ b/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php @@ -38,13 +38,13 @@ class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); // Single. $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/taxonomies/post_tag' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); - $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); + $this->assertSameSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] ); } public function test_get_items() { diff --git a/tests/phpunit/tests/rest-api/rest-themes-controller.php b/tests/phpunit/tests/rest-api/rest-themes-controller.php index 94697c0000..1689879845 100644 --- a/tests/phpunit/tests/rest-api/rest-themes-controller.php +++ b/tests/phpunit/tests/rest-api/rest-themes-controller.php @@ -166,7 +166,7 @@ class WP_Test_REST_Themes_Controller extends WP_Test_REST_Controller_Testcase { 'theme_uri', 'version', ); - $this->assertEqualSets( $fields, array_keys( $data[0] ) ); + $this->assertSameSets( $fields, array_keys( $data[0] ) ); } /** diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 0b6129c7db..bf8adbf671 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -3055,7 +3055,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { $this->assertArrayNotHasKey( 'locale', $data ); } - $this->assertEqualSets( + $this->assertSameSets( array( 'self', 'collection', diff --git a/tests/phpunit/tests/rewrite/permastructs.php b/tests/phpunit/tests/rewrite/permastructs.php index e93062bb46..548f64bbfd 100644 --- a/tests/phpunit/tests/rewrite/permastructs.php +++ b/tests/phpunit/tests/rewrite/permastructs.php @@ -15,7 +15,7 @@ class Tests_Rewrite_Permastructs extends WP_UnitTestCase { global $wp_rewrite; add_permastruct( 'foo', 'bar/%foo%' ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'with_front' => true, 'ep_mask' => EP_NONE, diff --git a/tests/phpunit/tests/rewrite/rewriteTags.php b/tests/phpunit/tests/rewrite/rewriteTags.php index a636b9fd63..402f5ed4c6 100644 --- a/tests/phpunit/tests/rewrite/rewriteTags.php +++ b/tests/phpunit/tests/rewrite/rewriteTags.php @@ -48,9 +48,9 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { global $wp_rewrite; add_rewrite_tag( $tag, $regex ); - $this->assertEqualSets( $this->rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); - $this->assertEqualSets( $this->queryreplace, $wp_rewrite->queryreplace ); + $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); + $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); } public function test_add_rewrite_tag_empty_query() { @@ -60,9 +60,9 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { $rewritecode[] = '%foo%'; add_rewrite_tag( '%foo%', 'bar' ); - $this->assertEqualSets( $rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); - $this->assertEqualSets( array_merge( $this->queryreplace, array( 'foo=' ) ), $wp_rewrite->queryreplace ); + $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); + $this->assertSameSets( array_merge( $this->queryreplace, array( 'foo=' ) ), $wp_rewrite->queryreplace ); } public function test_add_rewrite_tag_custom_query() { @@ -72,9 +72,9 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { $rewritecode[] = '%foo%'; add_rewrite_tag( '%foo%', 'bar', 'baz=' ); - $this->assertEqualSets( $rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); - $this->assertEqualSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); + $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); + $this->assertSameSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); } public function test_add_rewrite_tag_updates_existing() { @@ -94,14 +94,14 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { $rewritecode = $wp_rewrite->rewritecode; $rewritecode[] = '%foo%'; add_rewrite_tag( '%foo%', 'bar', 'baz=' ); - $this->assertEqualSets( $rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); - $this->assertEqualSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); + $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); + $this->assertSameSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); remove_rewrite_tag( '%foo%' ); - $this->assertEqualSets( $this->rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); - $this->assertEqualSets( $this->queryreplace, $wp_rewrite->queryreplace ); + $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); + $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); } public function test_remove_rewrite_tag_internal_tag() { @@ -126,14 +126,14 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { $rewritereplace = $wp_rewrite->rewritereplace; $rewritereplace[] = '([0-9]{1,2})'; add_rewrite_tag( '%foo%', '([0-9]{1,2})', 'post_type=foo&name=' ); - $this->assertEqualSets( $rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( $rewritereplace, $wp_rewrite->rewritereplace ); - $this->assertEqualSets( array_merge( $this->queryreplace, array( 'post_type=foo&name=' ) ), $wp_rewrite->queryreplace ); + $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( $rewritereplace, $wp_rewrite->rewritereplace ); + $this->assertSameSets( array_merge( $this->queryreplace, array( 'post_type=foo&name=' ) ), $wp_rewrite->queryreplace ); remove_rewrite_tag( '%foo%' ); - $this->assertEqualSets( $this->rewritecode, $wp_rewrite->rewritecode ); - $this->assertEqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); - $this->assertEqualSets( $this->queryreplace, $wp_rewrite->queryreplace ); + $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); + $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); + $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); $this->assertNotContains( '%foo%', $wp_rewrite->rewritecode ); $this->assertContains( '([0-9]{1,2})', $wp_rewrite->rewritereplace ); diff --git a/tests/phpunit/tests/sitemaps/sitemaps-users.php b/tests/phpunit/tests/sitemaps/sitemaps-users.php index 975462044c..6e625f5fcc 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps-users.php +++ b/tests/phpunit/tests/sitemaps/sitemaps-users.php @@ -52,6 +52,6 @@ class Test_WP_Sitemaps_Users extends WP_UnitTestCase { $url_list = $user_provider->get_url_list( 1 ); - $this->assertEqualSets( $expected, $url_list ); + $this->assertSameSets( $expected, $url_list ); } } diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php index 436a35f4b9..1ce512c6ac 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps.php +++ b/tests/phpunit/tests/sitemaps/sitemaps.php @@ -283,7 +283,7 @@ class Test_Sitemaps extends WP_UnitTestCase { ); $this->assertNotContains( $private_post, $post_list_after ); - $this->assertEqualSets( $post_list_before, $post_list_after ); + $this->assertSameSets( $post_list_before, $post_list_after ); } /** diff --git a/tests/phpunit/tests/taxonomy.php b/tests/phpunit/tests/taxonomy.php index 62480b4d2b..f2f023dbad 100644 --- a/tests/phpunit/tests/taxonomy.php +++ b/tests/phpunit/tests/taxonomy.php @@ -279,7 +279,7 @@ class Tests_Taxonomy extends WP_UnitTestCase { $tax = get_taxonomy( 'wptests_tax' ); $expected = array( 'post' ); - $this->assertEqualSets( $expected, $tax->object_type ); + $this->assertSameSets( $expected, $tax->object_type ); } public function test_get_objects_in_term_should_return_invalid_taxonomy_error() { @@ -494,7 +494,7 @@ class Tests_Taxonomy extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t2, $t1 ), get_ancestors( $t3, 'wptests_tax' ) ); + $this->assertSameSets( array( $t2, $t1 ), get_ancestors( $t3, 'wptests_tax' ) ); _unregister_taxonomy( 'wptests_tax' ); } @@ -506,7 +506,7 @@ class Tests_Taxonomy extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array(), get_ancestors( $p, 'wptests_tax' ) ); + $this->assertSameSets( array(), get_ancestors( $p, 'wptests_tax' ) ); } public function test_get_ancestors_post_type() { @@ -540,7 +540,7 @@ class Tests_Taxonomy extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p2, $p1 ), get_ancestors( $p3, 'wptests_pt' ) ); + $this->assertSameSets( array( $p2, $p1 ), get_ancestors( $p3, 'wptests_pt' ) ); _unregister_post_type( 'wptests_pt' ); } @@ -585,9 +585,9 @@ class Tests_Taxonomy extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $p1 ), get_ancestors( $p2, 'wptests_conflict', 'post_type' ) ); - $this->assertEqualSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict', 'taxonomy' ) ); - $this->assertEqualSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict' ) ); + $this->assertSameSets( array( $p1 ), get_ancestors( $p2, 'wptests_conflict', 'post_type' ) ); + $this->assertSameSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict', 'taxonomy' ) ); + $this->assertSameSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict' ) ); _unregister_post_type( 'wptests_pt' ); } diff --git a/tests/phpunit/tests/term/cache.php b/tests/phpunit/tests/term/cache.php index 4361c34893..9847f37460 100644 --- a/tests/phpunit/tests/term/cache.php +++ b/tests/phpunit/tests/term/cache.php @@ -455,7 +455,7 @@ class Tests_Term_Cache extends WP_UnitTestCase { // Prime cache. $terms = get_the_terms( $p, 'wptests_tax' ); - $this->assertEqualSets( array( $t ), wp_list_pluck( $terms, 'term_id' ) ); + $this->assertSameSets( array( $t ), wp_list_pluck( $terms, 'term_id' ) ); /* * Modify cached array to insert an empty term ID, diff --git a/tests/phpunit/tests/term/getTerms.php b/tests/phpunit/tests/term/getTerms.php index 52fd7cf098..cb17e84238 100644 --- a/tests/phpunit/tests/term/getTerms.php +++ b/tests/phpunit/tests/term/getTerms.php @@ -33,7 +33,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term1 ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $term1 ), wp_list_pluck( $found, 'term_id' ) ); } /** @@ -52,7 +52,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term ), $found ); + $this->assertSameSets( array( $term ), $found ); } /** @@ -65,7 +65,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $found = get_terms( 'wptests_tax', 'hide_empty=0&fields=ids&update_term_meta_cache=0' ); - $this->assertEqualSets( array( $term ), $found ); + $this->assertSameSets( array( $term ), $found ); } /** @@ -78,7 +78,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $found = get_terms( 'taxonomy=wptests_tax&hide_empty=0&fields=ids&update_term_meta_cache=0' ); - $this->assertEqualSets( array( $term ), $found ); + $this->assertSameSets( array( $term ), $found ); } /** @@ -243,7 +243,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms_ids ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms_ids ); $terms_name = get_terms( 'post_tag', @@ -252,7 +252,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'names', ) ); - $this->assertEqualSets( array( 'WOO!', 'HOO!' ), $terms_name ); + $this->assertSameSets( array( 'WOO!', 'HOO!' ), $terms_name ); $terms_id_name = get_terms( 'post_tag', @@ -419,7 +419,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms ); } /** @@ -447,7 +447,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1 ), $terms ); + $this->assertSameSets( array( $term_id1 ), $terms ); $terms2 = get_terms( 'post_tag', @@ -457,7 +457,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms2 ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms2 ); $terms3 = get_terms( 'post_tag', @@ -467,7 +467,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1 ), $terms3 ); + $this->assertSameSets( array( $term_id1 ), $terms3 ); $terms4 = get_terms( 'post_tag', @@ -477,7 +477,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms4 ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms4 ); $terms5 = get_terms( 'post_tag', @@ -507,7 +507,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms7 ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms7 ); $terms8 = get_terms( 'post_tag', @@ -517,7 +517,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms8 ); + $this->assertSameSets( array( $term_id1, $term_id2 ), $terms8 ); } /** @@ -845,7 +845,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t3 ), $found ); + $this->assertSameSets( array( $t3 ), $found ); } /** @@ -882,7 +882,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $result = _get_term_children( $c1, array( $c1, $c2, $c3 ), 'category' ); - $this->assertEqualSets( array( $c2, $c3 ), $result ); + $this->assertSameSets( array( $c2, $c3 ), $result ); } /** @@ -901,7 +901,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $result = _get_term_children( $c1->term_id, array( $c1, $c2, $c3 ), 'category' ); - $this->assertEqualSets( array( $c2, $c3 ), $result ); + $this->assertSameSets( array( $c2, $c3 ), $result ); } public function test_get_terms_by_slug() { @@ -976,7 +976,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t3, $t1 ), $found ); + $this->assertSameSets( array( $t3, $t1 ), $found ); } /** @@ -1001,7 +1001,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'name' => 'Foo & Bar', ) ); - $this->assertEqualSets( array( $t ), $found ); + $this->assertSameSets( array( $t ), $found ); // Array format. $found = get_terms( @@ -1012,7 +1012,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'name' => array( 'Foo & Bar' ), ) ); - $this->assertEqualSets( array( $t ), $found ); + $this->assertSameSets( array( $t ), $found ); } /** @@ -1043,7 +1043,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t ), $found ); + $this->assertSameSets( array( $t ), $found ); } /** @@ -1082,7 +1082,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ); $expected = array( $australia, $china, $tanzania ); - $this->assertEqualSets( $expected, $terms ); + $this->assertSameSets( $expected, $terms ); } @@ -1174,7 +1174,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $montreal, $nepean, $toronto, $pei ), $terms ); + $this->assertSameSets( array( $montreal, $nepean, $toronto, $pei ), $terms ); } /** @@ -1243,7 +1243,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $laval ), $terms ); + $this->assertSameSets( array( $laval ), $terms ); } /** @@ -1277,7 +1277,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t2, $t4 ), $found ); + $this->assertSameSets( array( $t2, $t4 ), $found ); } public function test_get_terms_hierarchical_tax_hide_empty_false_fields_ids() { @@ -1305,7 +1305,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_ids() { @@ -1331,7 +1331,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_ids_hierarchical_false() { @@ -1357,7 +1357,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_false_fields_names() { @@ -1385,7 +1385,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_names() { @@ -1411,7 +1411,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_names_hierarchical_false() { @@ -1437,7 +1437,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_false_fields_count() { @@ -1607,7 +1607,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } /** @@ -1636,7 +1636,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_idslug_hierarchical_false() { @@ -1662,7 +1662,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_false_fields_idname() { @@ -1690,7 +1690,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } /** @@ -1719,7 +1719,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } public function test_get_terms_hierarchical_tax_hide_empty_true_fields_idname_hierarchical_false() { @@ -1745,7 +1745,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { _unregister_taxonomy( 'hierarchical_fields' ); - $this->assertEqualSetsWithIndex( $expected, $found ); + $this->assertSameSetsWithIndex( $expected, $found ); } /** @@ -1957,7 +1957,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); } /** @@ -1995,7 +1995,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); } /** @@ -2025,7 +2025,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); $found = get_terms( 'wptests_tax', @@ -2044,7 +2044,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); // Matches the first meta query clause. $found = get_terms( @@ -2069,7 +2069,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); // Matches the meta query clause corresponding to the 'meta_key' param. $found = get_terms( @@ -2094,7 +2094,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[0], $terms[2] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); } /** @@ -2124,7 +2124,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); $found = get_terms( 'wptests_tax', @@ -2143,7 +2143,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); $found = get_terms( 'wptests_tax', @@ -2167,7 +2167,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); $found = get_terms( 'wptests_tax', @@ -2191,7 +2191,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[0], $terms[2] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); } /** @@ -2228,7 +2228,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[2], $terms[0] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); $found = get_terms( 'wptests_tax', @@ -2251,7 +2251,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[1], $terms[0], $terms[2] ), $found ); + $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); $expected = get_terms( 'wptests_tax', @@ -2292,7 +2292,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_hierarchical_false_with_parent() { @@ -2332,7 +2332,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $initial_terms['five_term']['term_id'], ); $actual = wp_list_pluck( $terms, 'term_id' ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } public function test_hierarchical_false_with_child_of_and_direct_child() { @@ -2358,7 +2358,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ); $actual = wp_list_pluck( $terms, 'term_id' ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } public function test_hierarchical_false_with_child_of_should_not_return_grandchildren() { @@ -2396,7 +2396,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $initial_terms['six_term']['term_id'], ); $actual = wp_list_pluck( $terms, 'term_id' ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } public function test_parent_should_override_child_of() { @@ -2418,7 +2418,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $initial_terms['seven_term']['term_id'], ); $actual = wp_list_pluck( $terms, 'term_id' ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } /** @@ -2470,7 +2470,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t3 ), $found ); + $this->assertSameSets( array( $t3 ), $found ); } public function test_hierarchical_false_parent_should_override_child_of() { @@ -2512,7 +2512,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { $initial_terms['five_term']['term_id'], ); $actual = wp_list_pluck( $terms, 'term_id' ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } public function test_pad_counts() { @@ -2549,7 +2549,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); foreach ( $found as $f ) { if ( $t1 === $f->term_id ) { @@ -2587,7 +2587,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $c1, $c2, $c3 ), wp_list_pluck( $terms, 'term_id' ) ); + $this->assertSameSets( array( $c1, $c2, $c3 ), wp_list_pluck( $terms, 'term_id' ) ); foreach ( $terms as $term ) { $this->assertSame( 3, $term->count ); @@ -2622,7 +2622,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); foreach ( $found as $f ) { if ( $t1 === $f->term_id ) { @@ -2719,7 +2719,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[1] ), $found ); + $this->assertSameSets( array( $terms[0], $terms[1] ), $found ); } /** @@ -2746,7 +2746,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0] ), $found ); + $this->assertSameSets( array( $terms[0] ), $found ); } /** @@ -2871,7 +2871,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'fields' => 'ids', ) ); - $this->assertEqualSets( $terms, $found ); + $this->assertSameSets( $terms, $found ); } /** @@ -2893,7 +2893,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'order' => 'ASC', ) ); - $this->assertEqualSets( array( $terms[1] ), $found ); + $this->assertSameSets( array( $terms[1] ), $found ); } /** @@ -2915,7 +2915,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'order' => 'ASC', ) ); - $this->assertEqualSets( array( $terms[1] ), $found ); + $this->assertSameSets( array( $terms[1] ), $found ); } /** @@ -2937,7 +2937,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { 'order' => 'ASC', ) ); - $this->assertEqualSets( array(), $found ); + $this->assertSameSets( array(), $found ); } /** @@ -2985,7 +2985,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term_id ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $term_id ), wp_list_pluck( $found, 'term_id' ) ); } /** @@ -3021,7 +3021,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term_id1, $term_id2 ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $term_id1, $term_id2 ), wp_list_pluck( $found, 'term_id' ) ); } protected function create_hierarchical_terms_and_posts() { diff --git a/tests/phpunit/tests/term/getTheTerms.php b/tests/phpunit/tests/term/getTheTerms.php index fb4d61a00f..af59c1b752 100644 --- a/tests/phpunit/tests/term/getTheTerms.php +++ b/tests/phpunit/tests/term/getTheTerms.php @@ -111,7 +111,7 @@ class Tests_Term_GetTheTerms extends WP_UnitTestCase { $found = get_the_terms( $p, 'wptests_tax' ); - $this->assertEqualSets( array( 0, 1 ), array_keys( $found ) ); + $this->assertSameSets( array( 0, 1 ), array_keys( $found ) ); } /** @@ -127,7 +127,7 @@ class Tests_Term_GetTheTerms extends WP_UnitTestCase { $found = get_the_terms( $p, 'wptests_tax' ); - $this->assertEqualSets( array( 0, 1 ), array_keys( $found ) ); + $this->assertSameSets( array( 0, 1 ), array_keys( $found ) ); } /** @@ -213,7 +213,7 @@ class Tests_Term_GetTheTerms extends WP_UnitTestCase { $num_queries = $wpdb->num_queries; $found = get_the_terms( self::$post_ids[0], 'wptests_tax' ); - $this->assertEqualSets( $terms, wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( $terms, wp_list_pluck( $found, 'term_id' ) ); $num_queries++; $this->assertSame( $num_queries, $wpdb->num_queries ); diff --git a/tests/phpunit/tests/term/meta.php b/tests/phpunit/tests/term/meta.php index 744fd0ba37..efde245153 100644 --- a/tests/phpunit/tests/term/meta.php +++ b/tests/phpunit/tests/term/meta.php @@ -66,7 +66,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { 'foo1' => array( 'baz' ), ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_with_key_should_fetch_all_for_key() { @@ -78,7 +78,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { $found = get_term_meta( $t, 'foo' ); $expected = array( 'bar', 'baz' ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_get_should_respect_single_true() { @@ -245,7 +245,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0] ), $found ); + $this->assertSameSets( array( $terms[0] ), $found ); add_term_meta( $terms[1], 'foo', 'bar' ); @@ -263,7 +263,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[1] ), $found ); + $this->assertSameSets( array( $terms[0], $terms[1] ), $found ); } public function test_updating_term_meta_should_bust_get_terms_cache() { @@ -287,7 +287,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0] ), $found ); + $this->assertSameSets( array( $terms[0] ), $found ); update_term_meta( $terms[1], 'foo', 'bar' ); @@ -305,7 +305,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[1] ), $found ); + $this->assertSameSets( array( $terms[0], $terms[1] ), $found ); } public function test_deleting_term_meta_should_bust_get_terms_cache() { @@ -329,7 +329,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[1] ), $found ); + $this->assertSameSets( array( $terms[0], $terms[1] ), $found ); delete_term_meta( $terms[1], 'foo', 'bar' ); @@ -347,7 +347,7 @@ class Tests_Term_Meta extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0] ), $found ); + $this->assertSameSets( array( $terms[0] ), $found ); } /** diff --git a/tests/phpunit/tests/term/query.php b/tests/phpunit/tests/term/query.php index a600999b40..425815cd17 100644 --- a/tests/phpunit/tests/term/query.php +++ b/tests/phpunit/tests/term/query.php @@ -22,7 +22,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term_2 ), $q->terms ); + $this->assertSameSets( array( $term_2 ), $q->terms ); } public function test_taxonomy_should_accept_taxonomy_array() { @@ -40,7 +40,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $term_2 ), $q->terms ); + $this->assertSameSets( array( $term_2 ), $q->terms ); } /** @@ -68,7 +68,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0] ), $q->terms ); + $this->assertSameSets( array( $terms[0] ), $q->terms ); } /** @@ -102,7 +102,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[2] ), $q->terms ); + $this->assertSameSets( array( $terms[0], $terms[2] ), $q->terms ); } /** @@ -243,7 +243,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t ), $query->terms ); + $this->assertSameSets( array( $t ), $query->terms ); } /** @@ -265,7 +265,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t ), $query->terms ); + $this->assertSameSets( array( $t ), $query->terms ); } /** @@ -374,7 +374,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ); $found = $query->get_terms(); - $this->assertEqualSets( array( $terms[0] ), $found ); + $this->assertSameSets( array( $terms[0] ), $found ); wp_set_object_terms( $p, array( $terms[1] ), 'wptests_tax_1' ); @@ -387,7 +387,7 @@ class Tests_Term_Query extends WP_UnitTestCase { ); $found = $query->get_terms(); - $this->assertEqualSets( array( $terms[1] ), $found ); + $this->assertSameSets( array( $terms[1] ), $found ); } /** @@ -690,7 +690,7 @@ class Tests_Term_Query extends WP_UnitTestCase { $expected = array( $terms[0], $terms[2] ); - $this->assertEqualSets( $expected, wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $found, 'term_id' ) ); } public function filter_term_to_null( $term ) { @@ -727,7 +727,7 @@ class Tests_Term_Query extends WP_UnitTestCase { $expected = array( $terms[0], $terms[2] ); - $this->assertEqualSets( $expected, wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( $expected, wp_list_pluck( $found, 'term_id' ) ); } public function filter_term_to_wp_error( $term ) { diff --git a/tests/phpunit/tests/term/splitSharedTerm.php b/tests/phpunit/tests/term/splitSharedTerm.php index e3563fd348..71acca0c77 100644 --- a/tests/phpunit/tests/term/splitSharedTerm.php +++ b/tests/phpunit/tests/term/splitSharedTerm.php @@ -312,7 +312,7 @@ class Tests_Term_SplitSharedTerm extends WP_UnitTestCase { 'wptests_tax_3' => $this->terms['t3']['term_id'], ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } public function test_wp_get_split_term() { diff --git a/tests/phpunit/tests/term/wpDeleteObjectTermRelationships.php b/tests/phpunit/tests/term/wpDeleteObjectTermRelationships.php index 319a8186f6..e4ee55f46d 100644 --- a/tests/phpunit/tests/term/wpDeleteObjectTermRelationships.php +++ b/tests/phpunit/tests/term/wpDeleteObjectTermRelationships.php @@ -19,13 +19,13 @@ class Tests_Term_WpDeleteObjectTermRelationships extends WP_UnitTestCase { // Confirm the setup. $terms = wp_get_object_terms( $object_id, array( 'wptests_tax1', 'wptests_tax2' ), array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $t1, $t2 ), $terms ); + $this->assertSameSets( array( $t1, $t2 ), $terms ); // wp_delete_object_term_relationships() doesn't have a return value. wp_delete_object_term_relationships( $object_id, 'wptests_tax2' ); $terms = wp_get_object_terms( $object_id, array( 'wptests_tax1', 'wptests_tax2' ), array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $t1 ), $terms ); + $this->assertSameSets( array( $t1 ), $terms ); } public function test_array_of_taxonomies() { @@ -45,12 +45,12 @@ class Tests_Term_WpDeleteObjectTermRelationships extends WP_UnitTestCase { // Confirm the setup. $terms = wp_get_object_terms( $object_id, array( 'wptests_tax1', 'wptests_tax2', 'wptests_tax3' ), array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $t1, $t2, $t3 ), $terms ); + $this->assertSameSets( array( $t1, $t2, $t3 ), $terms ); // wp_delete_object_term_relationships() doesn't have a return value. wp_delete_object_term_relationships( $object_id, array( 'wptests_tax1', 'wptests_tax3' ) ); $terms = wp_get_object_terms( $object_id, array( 'wptests_tax1', 'wptests_tax2', 'wptests_tax3' ), array( 'fields' => 'ids' ) ); - $this->assertEqualSets( array( $t2 ), $terms ); + $this->assertSameSets( array( $t2 ), $terms ); } } diff --git a/tests/phpunit/tests/term/wpGetObjectTerms.php b/tests/phpunit/tests/term/wpGetObjectTerms.php index 660b9e3d2a..53bbf22de9 100644 --- a/tests/phpunit/tests/term/wpGetObjectTerms.php +++ b/tests/phpunit/tests/term/wpGetObjectTerms.php @@ -589,7 +589,7 @@ class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t1, $t2 ), $found ); + $this->assertSameSets( array( $t1, $t2 ), $found ); } /** @@ -743,7 +743,7 @@ class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $terms[0], $terms[1] ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $terms[0], $terms[1] ), wp_list_pluck( $found, 'term_id' ) ); } /** @@ -866,7 +866,7 @@ class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $t1, $t2 ), wp_list_pluck( $found, 'term_id' ) ); + $this->assertSameSets( array( $t1, $t2 ), wp_list_pluck( $found, 'term_id' ) ); $num_queries = $wpdb->num_queries; $term1 = get_term( $t1 ); @@ -892,7 +892,7 @@ class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $posts, wp_list_pluck( $found, 'object_id' ) ); + $this->assertSameSets( $posts, wp_list_pluck( $found, 'object_id' ) ); } public function filter_get_object_terms( $terms ) { @@ -999,6 +999,6 @@ class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { ) ); - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } } diff --git a/tests/phpunit/tests/term/wpSetObjectTerms.php b/tests/phpunit/tests/term/wpSetObjectTerms.php index 79e7f35b05..8984dc940d 100644 --- a/tests/phpunit/tests/term/wpSetObjectTerms.php +++ b/tests/phpunit/tests/term/wpSetObjectTerms.php @@ -184,11 +184,11 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase { $added1 = wp_set_object_terms( $p, array( $t1 ), 'wptests_tax' ); $this->assertNotEmpty( $added1 ); - $this->assertEqualSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); $added2 = wp_set_object_terms( $p, array( $t2 ), 'wptests_tax', true ); $this->assertNotEmpty( $added2 ); - $this->assertEqualSets( array( $t1, $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t1, $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); _unregister_taxonomy( 'wptests_tax' ); } @@ -209,11 +209,11 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase { $added1 = wp_set_object_terms( $p, array( $t1 ), 'wptests_tax' ); $this->assertNotEmpty( $added1 ); - $this->assertEqualSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); $added2 = wp_set_object_terms( $p, array( $t2 ), 'wptests_tax', false ); $this->assertNotEmpty( $added2 ); - $this->assertEqualSets( array( $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); _unregister_taxonomy( 'wptests_tax' ); } @@ -234,11 +234,11 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase { $added1 = wp_set_object_terms( $p, array( $t1 ), 'wptests_tax' ); $this->assertNotEmpty( $added1 ); - $this->assertEqualSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t1 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); $added2 = wp_set_object_terms( $p, array( $t2 ), 'wptests_tax' ); $this->assertNotEmpty( $added2 ); - $this->assertEqualSets( array( $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); + $this->assertSameSets( array( $t2 ), wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'ids' ) ) ); _unregister_taxonomy( 'wptests_tax' ); } diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 2214a45550..50bb911cee 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -429,7 +429,7 @@ class Tests_Theme extends WP_UnitTestCase { 'description' => '', 'show_in_rest' => false, ); - $this->assertEqualSets( $expected, get_registered_theme_feature( 'test-feature' ) ); + $this->assertSameSets( $expected, get_registered_theme_feature( 'test-feature' ) ); } /** @@ -466,8 +466,8 @@ class Tests_Theme extends WP_UnitTestCase { $expected = array( 'schema' => array( - 'type' => 'boolean', 'description' => '', + 'type' => 'boolean', 'default' => false, ), 'name' => 'test-feature', @@ -475,7 +475,7 @@ class Tests_Theme extends WP_UnitTestCase { ); $actual = get_registered_theme_feature( 'test-feature' )['show_in_rest']; - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } /** @@ -509,7 +509,7 @@ class Tests_Theme extends WP_UnitTestCase { ); $actual = get_registered_theme_feature( 'test-feature' )['show_in_rest']['schema']; - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } /** @@ -587,7 +587,7 @@ class Tests_Theme extends WP_UnitTestCase { ); $actual = get_registered_theme_feature( 'test-feature' )['show_in_rest']['schema']['additionalProperties']; - $this->assertEqualSets( $expected, $actual ); + $this->assertSameSets( $expected, $actual ); } /** diff --git a/tests/phpunit/tests/theme/WPTheme.php b/tests/phpunit/tests/theme/WPTheme.php index c1583cd640..28edec92ed 100644 --- a/tests/phpunit/tests/theme/WPTheme.php +++ b/tests/phpunit/tests/theme/WPTheme.php @@ -165,7 +165,7 @@ class Tests_Theme_WPTheme extends WP_UnitTestCase { update_site_option( 'allowedthemes', $current_allowed_themes ); // Reset previous value. $current_allowed_themes['testtheme-1'] = true; // Add the new theme to the previous set. - $this->assertEqualSetsWithIndex( $current_allowed_themes, $new_allowed_themes ); + $this->assertSameSetsWithIndex( $current_allowed_themes, $new_allowed_themes ); } /** @@ -188,7 +188,7 @@ class Tests_Theme_WPTheme extends WP_UnitTestCase { ) ); - $this->assertEqualSetsWithIndex( $current_allowed_themes, $new_allowed_themes ); + $this->assertSameSetsWithIndex( $current_allowed_themes, $new_allowed_themes ); } /** @@ -213,7 +213,7 @@ class Tests_Theme_WPTheme extends WP_UnitTestCase { update_site_option( 'allowedthemes', $current_allowed_themes ); // Reset previous value. unset( $allowed_themes[ $disable_theme ] ); // Remove deleted theme from initial set. - $this->assertEqualSetsWithIndex( $allowed_themes, $new_allowed_themes ); + $this->assertSameSetsWithIndex( $allowed_themes, $new_allowed_themes ); } /** @@ -239,6 +239,6 @@ class Tests_Theme_WPTheme extends WP_UnitTestCase { unset( $allowed_themes['existing-4'] ); unset( $allowed_themes['existing-5'] ); - $this->assertEqualSetsWithIndex( $allowed_themes, $new_allowed_themes ); + $this->assertSameSetsWithIndex( $allowed_themes, $new_allowed_themes ); } } diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index a21ff18330..b9d93325aa 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -88,7 +88,7 @@ class Tests_User extends WP_UnitTestCase { } // Make sure every user we created was returned. - $this->assertEqualSets( $nusers, $found ); + $this->assertSameSets( $nusers, $found ); } // Simple get/set tests for user_option functions. diff --git a/tests/phpunit/tests/user/countUsers.php b/tests/phpunit/tests/user/countUsers.php index bf4b3b8de6..e782f90f8d 100644 --- a/tests/phpunit/tests/user/countUsers.php +++ b/tests/phpunit/tests/user/countUsers.php @@ -197,7 +197,7 @@ class Tests_User_CountUsers extends WP_UnitTestCase { restore_current_blog(); $count = count_users( $strategy, $site_id ); - $this->assertEqualSetsWithIndex( + $this->assertSameSetsWithIndex( array( 'tester' => 1, 'none' => 0, @@ -278,7 +278,7 @@ class Tests_User_CountUsers extends WP_UnitTestCase { $count2 = count_users( $strategy ); - $this->assertEqualSets( $count, $count2 ); + $this->assertSameSets( $count, $count2 ); } function data_count_users_strategies() { diff --git a/tests/phpunit/tests/user/dateQuery.php b/tests/phpunit/tests/user/dateQuery.php index 434fd236d4..2dcfb02394 100644 --- a/tests/phpunit/tests/user/dateQuery.php +++ b/tests/phpunit/tests/user/dateQuery.php @@ -30,7 +30,7 @@ class Tests_User_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $u1 ), wp_list_pluck( $uq->results, 'ID' ) ); + $this->assertSameSets( array( $u1 ), wp_list_pluck( $uq->results, 'ID' ) ); } /** @@ -67,6 +67,6 @@ class Tests_User_DateQuery extends WP_UnitTestCase { ) ); - $this->assertEqualSets( array( $u1, $u2 ), wp_list_pluck( $uq->results, 'ID' ) ); + $this->assertSameSets( array( $u1, $u2 ), wp_list_pluck( $uq->results, 'ID' ) ); } } diff --git a/tests/phpunit/tests/user/query.php b/tests/phpunit/tests/user/query.php index 15b1e72ac7..d2a732db46 100644 --- a/tests/phpunit/tests/user/query.php +++ b/tests/phpunit/tests/user/query.php @@ -847,7 +847,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[0] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -888,7 +888,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[1], self::$author_ids[2] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -929,7 +929,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[2] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -974,7 +974,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[1] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1004,7 +1004,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[0], self::$author_ids[1] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1042,7 +1042,7 @@ class Tests_User_Query extends WP_UnitTestCase { $found = wp_list_pluck( $q->get_results(), 'ID' ); $expected = array( self::$author_ids[0], self::$author_ids[1] ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1066,7 +1066,7 @@ class Tests_User_Query extends WP_UnitTestCase { $expected = array( self::$author_ids[0] ); $this->assertContains( "AND user_nicename = 'peter'", $q->query_where ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1104,7 +1104,7 @@ class Tests_User_Query extends WP_UnitTestCase { $expected = array( self::$author_ids[0], self::$author_ids[1], self::$author_ids[2] ); $this->assertContains( "AND user_nicename IN ( 'peter','paul','mary' )", $q->query_where ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1201,7 +1201,7 @@ class Tests_User_Query extends WP_UnitTestCase { $expected = array( self::$author_ids[0] ); $this->assertContains( "AND user_login = '$user_login'", $q->query_where ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** @@ -1222,7 +1222,7 @@ class Tests_User_Query extends WP_UnitTestCase { $expected = array( self::$author_ids[0], self::$author_ids[1], self::$author_ids[2] ); $this->assertContains( "AND user_login IN ( '$user_login1','$user_login2','$user_login3' )", $q->query_where ); - $this->assertEqualSets( $expected, $found ); + $this->assertSameSets( $expected, $found ); } /** diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php index ded364802b..1347de0be7 100644 --- a/tests/phpunit/tests/widgets.php +++ b/tests/phpunit/tests/widgets.php @@ -977,7 +977,7 @@ class Tests_Widgets extends WP_UnitTestCase { $this->assertContains( 'recent-comments-2', $sidebars_widgets['wp_inactive_widgets'] ); // Theme mod with previous widgets was not removed. - $this->assertEqualSets( $old_sidebars_widgets, get_theme_mod( 'sidebars_widgets' ) ); + $this->assertSameSets( $old_sidebars_widgets, get_theme_mod( 'sidebars_widgets' ) ); // Sidebar_widgets option was not updated. $this->assertNotEquals( $sidebars_widgets, wp_get_sidebars_widgets() ); @@ -1149,7 +1149,7 @@ class Tests_Widgets extends WP_UnitTestCase { 'main' => array(), 'wp_inactive_widgets' => array(), ); - $this->assertEqualSets( $expected_sidebars, $new_next_theme_sidebars ); + $this->assertSameSets( $expected_sidebars, $new_next_theme_sidebars ); } /** diff --git a/tests/phpunit/tests/widgets/media-audio-widget.php b/tests/phpunit/tests/widgets/media-audio-widget.php index fe5df88dcd..a4e3afd60f 100644 --- a/tests/phpunit/tests/widgets/media-audio-widget.php +++ b/tests/phpunit/tests/widgets/media-audio-widget.php @@ -35,7 +35,7 @@ class Test_WP_Widget_Media_Audio extends WP_UnitTestCase { $wp_widget_audio = new WP_Widget_Media_Audio(); $schema = $wp_widget_audio->get_instance_schema(); - $this->assertEqualSets( + $this->assertSameSets( array_merge( array( 'attachment_id', @@ -95,7 +95,7 @@ class Test_WP_Widget_Media_Audio extends WP_UnitTestCase { $this->assertArrayHasKey( 'description', $widget->widget_options ); $this->assertTrue( $widget->widget_options['customize_selective_refresh'] ); $this->assertSame( 'audio', $widget->widget_options['mime_type'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'add_to_widget', 'replace_media', diff --git a/tests/phpunit/tests/widgets/media-gallery-widget.php b/tests/phpunit/tests/widgets/media-gallery-widget.php index f27fbccfba..091b3b3c5f 100644 --- a/tests/phpunit/tests/widgets/media-gallery-widget.php +++ b/tests/phpunit/tests/widgets/media-gallery-widget.php @@ -35,7 +35,7 @@ class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { $widget = new WP_Widget_Media_Gallery(); $schema = $widget->get_instance_schema(); - $this->assertEqualSets( + $this->assertSameSets( array( 'title', 'ids', diff --git a/tests/phpunit/tests/widgets/media-image-widget.php b/tests/phpunit/tests/widgets/media-image-widget.php index 999eae18df..a89c8ad6b6 100644 --- a/tests/phpunit/tests/widgets/media-image-widget.php +++ b/tests/phpunit/tests/widgets/media-image-widget.php @@ -35,7 +35,7 @@ class Test_WP_Widget_Media_Image extends WP_UnitTestCase { $widget = new WP_Widget_Media_Image(); $schema = $widget->get_instance_schema(); - $this->assertEqualSets( + $this->assertSameSets( array( 'alt', 'attachment_id', @@ -102,7 +102,7 @@ class Test_WP_Widget_Media_Image extends WP_UnitTestCase { $this->assertArrayHasKey( 'description', $widget->widget_options ); $this->assertTrue( $widget->widget_options['customize_selective_refresh'] ); $this->assertSame( 'image', $widget->widget_options['mime_type'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'add_to_widget', 'replace_media', diff --git a/tests/phpunit/tests/widgets/media-video-widget.php b/tests/phpunit/tests/widgets/media-video-widget.php index a2776b5831..77a83c6ef0 100644 --- a/tests/phpunit/tests/widgets/media-video-widget.php +++ b/tests/phpunit/tests/widgets/media-video-widget.php @@ -35,7 +35,7 @@ class Test_WP_Widget_Media_Video extends WP_UnitTestCase { $widget = new WP_Widget_Media_Video(); $schema = $widget->get_instance_schema(); - $this->assertEqualSets( + $this->assertSameSets( array_merge( array( 'attachment_id', @@ -96,7 +96,7 @@ class Test_WP_Widget_Media_Video extends WP_UnitTestCase { $this->assertArrayHasKey( 'description', $widget->widget_options ); $this->assertTrue( $widget->widget_options['customize_selective_refresh'] ); $this->assertSame( 'video', $widget->widget_options['mime_type'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'add_to_widget', 'replace_media', diff --git a/tests/phpunit/tests/widgets/media-widget.php b/tests/phpunit/tests/widgets/media-widget.php index db1baa4dab..f91b5e12c1 100644 --- a/tests/phpunit/tests/widgets/media-widget.php +++ b/tests/phpunit/tests/widgets/media-widget.php @@ -62,7 +62,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { $this->assertArrayHasKey( 'description', $widget->widget_options ); $this->assertTrue( $widget->widget_options['customize_selective_refresh'] ); $this->assertEmpty( $widget->widget_options['mime_type'] ); - $this->assertEqualSets( + $this->assertSameSets( array( 'add_to_widget', 'replace_media', @@ -206,7 +206,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { $widget = $this->get_mocked_class_instance(); $schema = $widget->get_instance_schema(); - $this->assertEqualSets( + $this->assertSameSets( array( 'attachment_id', 'title', @@ -221,7 +221,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { $schema = $widget->get_instance_schema(); $this->assertInternalType( 'array', $this->filter_instance_schema_args ); $this->assertSame( $widget, $this->filter_instance_schema_args['widget'] ); - $this->assertEqualSets( array( 'attachment_id', 'title', 'url' ), array_keys( $this->filter_instance_schema_args['schema'] ) ); + $this->assertSameSets( array( 'attachment_id', 'title', 'url' ), array_keys( $this->filter_instance_schema_args['schema'] ) ); $this->assertArrayHasKey( 'injected', $schema ); } @@ -419,7 +419,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { ); $result = $widget->display_media_state( array(), get_post( $attachment_id ) ); - $this->assertEqualSets( array(), $result ); + $this->assertSameSets( array(), $result ); $widget->save_settings( array( @@ -429,7 +429,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { ) ); $result = $widget->display_media_state( array(), get_post( $attachment_id ) ); - $this->assertEqualSets( array( $widget->l10n['media_library_state_single'] ), $result ); + $this->assertSameSets( array( $widget->l10n['media_library_state_single'] ), $result ); $widget->save_settings( array( @@ -442,7 +442,7 @@ class Test_WP_Widget_Media extends WP_UnitTestCase { ) ); $result = $widget->display_media_state( array(), get_post( $attachment_id ) ); - $this->assertEqualSets( array( sprintf( $widget->l10n['media_library_state_multi']['singular'], 2 ) ), $result ); + $this->assertSameSets( array( sprintf( $widget->l10n['media_library_state_multi']['singular'], 2 ) ), $result ); } /** diff --git a/tests/phpunit/tests/xmlrpc/wp/getProfile.php b/tests/phpunit/tests/xmlrpc/wp/getProfile.php index 0b7f0b3ed9..5d57301ae3 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getProfile.php +++ b/tests/phpunit/tests/xmlrpc/wp/getProfile.php @@ -43,6 +43,6 @@ class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase { $keys = array_keys( $result ); sort( $expected_fields ); sort( $keys ); - $this->assertEqualSets( $expected_fields, $keys ); + $this->assertSameSets( $expected_fields, $keys ); } } diff --git a/tests/phpunit/tests/xmlrpc/wp/getUser.php b/tests/phpunit/tests/xmlrpc/wp/getUser.php index 3847e0bb10..9412dea89b 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getUser.php +++ b/tests/phpunit/tests/xmlrpc/wp/getUser.php @@ -130,7 +130,7 @@ class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { $keys = array_keys( $result ); sort( $expected_fields ); sort( $keys ); - $this->assertEqualSets( $expected_fields, $keys ); + $this->assertSameSets( $expected_fields, $keys ); } function test_arbitrary_fields() { @@ -146,6 +146,6 @@ class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { $keys = array_keys( $result ); sort( $expected_fields ); sort( $keys ); - $this->assertEqualSets( $expected_fields, $keys ); + $this->assertSameSets( $expected_fields, $keys ); } }