diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php index 1238291d59..b528067dc4 100644 --- a/tests/phpunit/tests/block-template-utils.php +++ b/tests/phpunit/tests/block-template-utils.php @@ -40,14 +40,14 @@ class Block_Template_Utils_Test extends WP_UnitTestCase { ); $this->assertNotWPError( $template ); - $this->assertEquals( get_stylesheet() . '//my_template', $template->id ); - $this->assertEquals( get_stylesheet(), $template->theme ); - $this->assertEquals( 'my_template', $template->slug ); - $this->assertEquals( 'publish', $template->status ); - $this->assertEquals( 'custom', $template->source ); - $this->assertEquals( 'My Template', $template->title ); - $this->assertEquals( 'Description of my template', $template->description ); - $this->assertEquals( 'wp_template', $template->type ); + $this->assertSame( get_stylesheet() . '//my_template', $template->id ); + $this->assertSame( get_stylesheet(), $template->theme ); + $this->assertSame( 'my_template', $template->slug ); + $this->assertSame( 'publish', $template->status ); + $this->assertSame( 'custom', $template->source ); + $this->assertSame( 'My Template', $template->title ); + $this->assertSame( 'Description of my template', $template->description ); + $this->assertSame( 'wp_template', $template->type ); } /** @@ -56,12 +56,12 @@ class Block_Template_Utils_Test extends WP_UnitTestCase { function test_get_block_template_from_post() { $id = get_stylesheet() . '//' . 'my_template'; $template = get_block_template( $id, 'wp_template' ); - $this->assertEquals( $id, $template->id ); - $this->assertEquals( get_stylesheet(), $template->theme ); - $this->assertEquals( 'my_template', $template->slug ); - $this->assertEquals( 'publish', $template->status ); - $this->assertEquals( 'custom', $template->source ); - $this->assertEquals( 'wp_template', $template->type ); + $this->assertSame( $id, $template->id ); + $this->assertSame( get_stylesheet(), $template->theme ); + $this->assertSame( 'my_template', $template->slug ); + $this->assertSame( 'publish', $template->status ); + $this->assertSame( 'custom', $template->source ); + $this->assertSame( 'wp_template', $template->type ); } /** @@ -87,11 +87,11 @@ class Block_Template_Utils_Test extends WP_UnitTestCase { // Filter by slug. $templates = get_block_templates( array( 'slug__in' => array( 'my_template' ) ), 'wp_template' ); $template_ids = get_template_ids( $templates ); - $this->assertEquals( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); + $this->assertSame( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); // Filter by CPT ID. $templates = get_block_templates( array( 'wp_id' => self::$post->ID ), 'wp_template' ); $template_ids = get_template_ids( $templates ); - $this->assertEquals( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); + $this->assertSame( array( get_stylesheet() . '//' . 'my_template' ), $template_ids ); } } diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php index 789b21eef1..c3918eacc2 100644 --- a/tests/phpunit/tests/block-template.php +++ b/tests/phpunit/tests/block-template.php @@ -54,7 +54,7 @@ class Block_Template_Test extends WP_UnitTestCase { 'page.php', ); $resolved_template_path = locate_block_template( $custom_page_template_path, $type, $templates ); - $this->assertEquals( $custom_page_template_path, $resolved_template_path ); + $this->assertSame( $custom_page_template_path, $resolved_template_path ); } /** @@ -73,8 +73,8 @@ class Block_Template_Test extends WP_UnitTestCase { 'page.php', ); $resolved_template_path = locate_block_template( $page_template_path, $type, $templates ); - $this->assertEquals( self::$template_canvas_path, $resolved_template_path ); - $this->assertEquals( self::$post->post_content, $_wp_current_template_content ); + $this->assertSame( self::$template_canvas_path, $resolved_template_path ); + $this->assertSame( self::$post->post_content, $_wp_current_template_content ); } /** @@ -82,6 +82,6 @@ class Block_Template_Test extends WP_UnitTestCase { */ function test_template_remains_unchanged_if_templates_array_is_empty() { $resolved_template_path = locate_block_template( '', 'search', array() ); - $this->assertEquals( '', $resolved_template_path ); + $this->assertSame( '', $resolved_template_path ); } } diff --git a/tests/phpunit/tests/bookmark/getBookmark.php b/tests/phpunit/tests/bookmark/getBookmark.php index b9d04bd09d..93e6ddf189 100644 --- a/tests/phpunit/tests/bookmark/getBookmark.php +++ b/tests/phpunit/tests/bookmark/getBookmark.php @@ -228,8 +228,8 @@ class Tests_Bookmark_GetBookmark extends WP_UnitTestCase { $actual_bookmark = get_bookmark( ...$args ); /* - * For non-array output type, use assetEquals. Why? The object pulled from cache will have the same - * property values but will be a different object than the expected object. + * For non-array output type, use assertEquals(). Why? The object pulled from the cache + * will have the same property values but will be a different object than the expected object. */ if ( is_object( $expected ) ) { $this->assertEquals( $expected, $actual_bookmark ); @@ -286,8 +286,8 @@ class Tests_Bookmark_GetBookmark extends WP_UnitTestCase { $actual_bookmark = get_bookmark( ...$args ); /* - * For non-array output type, use assetEquals. Why? The object pulled from the database will have the same - * property values but will be a different object than the expected object. + * For non-array output type, use assertEquals(). Why? The object pulled from the database + * will have the same property values but will be a different object than the expected object. */ if ( is_object( $expected ) ) { $this->assertEquals( $expected, $actual_bookmark ); diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index e0ae078bd0..44b8645442 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -1782,7 +1782,7 @@ class Tests_Post extends WP_UnitTestCase { function test_stick_post_with_duplicate_post_id_does_not_update_option() { update_option( 'sticky_posts', array( 1, 2, 2 ) ); stick_post( 2 ); - $this->assertEquals( array( 1, 2, 2 ), get_option( 'sticky_posts' ) ); + $this->assertSameSets( array( 1, 2, 2 ), get_option( 'sticky_posts' ) ); } /** @@ -1794,6 +1794,6 @@ class Tests_Post extends WP_UnitTestCase { function test_unstick_post_with_non_sticky_post_id_does_not_update_option() { update_option( 'sticky_posts', array( 1, 2, 2 ) ); unstick_post( 3 ); - $this->assertEquals( array( 1, 2, 2 ), get_option( 'sticky_posts' ) ); + $this->assertSameSets( array( 1, 2, 2 ), get_option( 'sticky_posts' ) ); } } diff --git a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php index 731e224964..ff9d8dfba5 100644 --- a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php +++ b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php @@ -132,7 +132,7 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( array(), $data ); + $this->assertSame( array(), $data ); } /** @@ -170,19 +170,19 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( array( 'id' => 'sidebar-1', 'name' => 'Test sidebar', 'description' => '', - 'status' => 'active', - 'widgets' => array(), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'active', + 'widgets' => array(), ), ), $data @@ -219,22 +219,22 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( array( 'id' => 'sidebar-1', 'name' => 'Test sidebar', 'description' => '', - 'status' => 'active', - 'widgets' => array( - 'text-1', - 'rss-1', - ), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'active', + 'widgets' => array( + 'text-1', + 'rss-1', + ), ), ), $data @@ -256,18 +256,18 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( 'id' => 'sidebar-1', 'name' => 'Test sidebar', 'description' => '', - 'status' => 'active', - 'widgets' => array(), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'active', + 'widgets' => array(), ), $data ); @@ -358,21 +358,21 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( 'id' => 'sidebar-1', 'name' => 'Test sidebar', 'description' => '', - 'status' => 'active', - 'widgets' => array( - 'text-1', - 'text-2', - ), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'active', + 'widgets' => array( + 'text-1', + 'text-2', + ), ), $data ); @@ -501,35 +501,35 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( array( 'id' => 'sidebar-1', 'name' => 'Test sidebar', 'description' => '', - 'status' => 'active', - 'widgets' => array( - 'text-1', - ), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'active', + 'widgets' => array( + 'text-1', + ), ), array( 'id' => 'wp_inactive_widgets', 'name' => 'Inactive widgets', 'description' => '', - 'status' => 'inactive', - 'widgets' => array( - 'rss-1', - ), 'class' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', + 'status' => 'inactive', + 'widgets' => array( + 'rss-1', + ), ), ), $data diff --git a/tests/phpunit/tests/rest-api/rest-templates-controller.php b/tests/phpunit/tests/rest-api/rest-templates-controller.php index b56950a82f..356c868d76 100644 --- a/tests/phpunit/tests/rest-api/rest-templates-controller.php +++ b/tests/phpunit/tests/rest-api/rest-templates-controller.php @@ -80,19 +80,19 @@ class WP_REST_Template_Controller_Test extends WP_Test_REST_Controller_Testcase $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( array( 'id' => 'default//my_template', 'theme' => 'default', 'slug' => 'my_template', + 'source' => 'custom', + 'type' => 'wp_template', + 'description' => 'Description of my template.', 'title' => array( 'raw' => 'My Template', 'rendered' => 'My Template', ), - 'description' => 'Description of my template.', 'status' => 'publish', - 'source' => 'custom', - 'type' => 'wp_template', 'wp_id' => self::$post->ID, 'has_theme_file' => false, ), @@ -108,19 +108,19 @@ class WP_REST_Template_Controller_Test extends WP_Test_REST_Controller_Testcase unset( $data['content'] ); unset( $data['_links'] ); - $this->assertEquals( + $this->assertSame( array( 'id' => 'default//my_template', 'theme' => 'default', 'slug' => 'my_template', + 'source' => 'custom', + 'type' => 'wp_template', + 'description' => 'Description of my template.', 'title' => array( 'raw' => 'My Template', 'rendered' => 'My Template', ), - 'description' => 'Description of my template.', 'status' => 'publish', - 'source' => 'custom', - 'type' => 'wp_template', 'wp_id' => self::$post->ID, 'has_theme_file' => false, ), @@ -134,8 +134,8 @@ class WP_REST_Template_Controller_Test extends WP_Test_REST_Controller_Testcase $request->set_body_params( array( 'slug' => 'my_custom_template', - 'title' => 'My Template', 'description' => 'Just a description', + 'title' => 'My Template', 'content' => 'Content', ) ); @@ -144,22 +144,22 @@ class WP_REST_Template_Controller_Test extends WP_Test_REST_Controller_Testcase unset( $data['_links'] ); unset( $data['wp_id'] ); - $this->assertEquals( + $this->assertSame( array( 'id' => 'default//my_custom_template', 'theme' => 'default', + 'content' => array( + 'raw' => 'Content', + ), 'slug' => 'my_custom_template', + 'source' => 'custom', + 'type' => 'wp_template', + 'description' => 'Just a description', 'title' => array( 'raw' => 'My Template', 'rendered' => 'My Template', ), - 'description' => 'Just a description', 'status' => 'publish', - 'source' => 'custom', - 'type' => 'wp_template', - 'content' => array( - 'raw' => 'Content', - ), 'has_theme_file' => false, ), $data @@ -176,8 +176,8 @@ class WP_REST_Template_Controller_Test extends WP_Test_REST_Controller_Testcase ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'My new Index Title', $data['title']['raw'] ); - $this->assertEquals( 'custom', $data['source'] ); + $this->assertSame( 'My new Index Title', $data['title']['raw'] ); + $this->assertSame( 'custom', $data['source'] ); } public function test_delete_item() { diff --git a/tests/phpunit/tests/rest-api/rest-widget-types-controller.php b/tests/phpunit/tests/rest-api/rest-widget-types-controller.php index fc4eddc2a8..e5e3010edf 100644 --- a/tests/phpunit/tests/rest-api/rest-widget-types-controller.php +++ b/tests/phpunit/tests/rest-api/rest-widget-types-controller.php @@ -307,7 +307,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc $request = new WP_REST_Request( 'POST', '/wp/v2/widget-types/search/encode' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( "
\n" . "\t\t\t\n" . "\t\t\t\n" . @@ -343,7 +343,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc $request->set_param( 'number', 8 ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( "
\n" . "\t\t\t\n" . "\t\t\t\n" . @@ -385,7 +385,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( "
\n" . "\t\t\t\n" . "\t\t\t\n" . @@ -421,7 +421,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc $request->set_param( 'form_data', 'widget-search[-1][title]=Updated+title' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( "
\n" . "\t\t\t\n" . "\t\t\t\n" . @@ -465,7 +465,7 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( + $this->assertSame( "
\n" . "\t\t\t\n" . "\t\t\t\n" . diff --git a/tests/phpunit/tests/rest-api/rest-widgets-controller.php b/tests/phpunit/tests/rest-api/rest-widgets-controller.php index 676f96fe9b..9e9605544f 100644 --- a/tests/phpunit/tests/rest-api/rest-widgets-controller.php +++ b/tests/phpunit/tests/rest-api/rest-widgets-controller.php @@ -211,7 +211,7 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( array(), $data ); + $this->assertSame( array(), $data ); } /** @@ -276,6 +276,7 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { array( array( 'id' => 'block-1', + 'id_base' => 'block', 'sidebar' => 'sidebar-1', 'instance' => array( 'encoded' => base64_encode( @@ -296,11 +297,11 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { 'content' => $block_content, ), ), - 'id_base' => 'block', 'rendered' => '
Block test
', ), array( 'id' => 'rss-1', + 'id_base' => 'rss', 'sidebar' => 'sidebar-1', 'instance' => array( 'encoded' => base64_encode( @@ -320,14 +321,13 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { ) ), ), - 'id_base' => 'rss', 'rendered' => 'Block test
', ), ), - 'id_base' => 'block', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'block-2', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'block-2', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'content' => 'Block test
', @@ -683,13 +683,13 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'POST', '/wp/v2/widgets' ); $request->set_body_params( array( + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'instance' => array( 'raw' => array( 'title' => 'Updated text test', ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); @@ -712,15 +712,15 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'POST', '/wp/v2/widgets' ); $request->set_body_params( array( + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'form_data' => 'widget-text[2][text]=Updated+text+test', - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-2', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-2', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Updated text test', @@ -745,17 +745,17 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'POST', '/wp/v2/widgets' ); $request->set_body_params( array( + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'instance' => array( 'raw' => array( 'text' => 'Text 1' ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-2', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-2', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Text 1', @@ -768,17 +768,17 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'POST', '/wp/v2/widgets' ); $request->set_body_params( array( + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'instance' => array( 'raw' => array( 'text' => 'Text 2' ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-3', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-3', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Text 2', @@ -814,19 +814,19 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request = new WP_REST_Request( 'POST', '/wp/v2/widgets' ); $request->set_body_params( array( + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'instance' => array( 'raw' => array( 'text' => 'Updated text test', ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-2', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-2', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Updated text test', @@ -860,20 +860,20 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request->set_body_params( array( 'id' => 'text-1', + 'id_base' => 'text', 'sidebar' => 'sidebar-1', 'instance' => array( 'raw' => array( 'text' => 'Updated text test', ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-1', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-1', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Updated text test', @@ -919,7 +919,7 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $error = $response->as_error(); $this->assertNotWPError( $error, $error ? $error->get_error_message() : '' ); - $this->assertEquals( 'sidebar-2', $response->get_data()['sidebar'] ); + $this->assertSame( 'sidebar-2', $response->get_data()['sidebar'] ); $sidebar1 = rest_do_request( '/wp/v2/sidebars/sidebar-1' ); $this->assertNotContains( 'text-1', $sidebar1->get_data()['widgets'] ); @@ -961,8 +961,8 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertEquals( 'text-1', $data['id'] ); - $this->assertEquals( 'sidebar-1', $data['sidebar'] ); + $this->assertSame( 'text-1', $data['id'] ); + $this->assertSame( 'sidebar-1', $data['sidebar'] ); $this->assertEqualSets( array( 'text' => 'Updated text test', @@ -978,12 +978,12 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { */ public function test_store_html_as_admin() { if ( is_multisite() ) { - $this->assertEquals( + $this->assertSame( '', $this->update_text_widget_with_raw_html( '' ) ); } else { - $this->assertEquals( + $this->assertSame( '', $this->update_text_widget_with_raw_html( '' ) ); @@ -996,12 +996,12 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { public function test_store_html_as_superadmin() { wp_set_current_user( self::$superadmin_id ); if ( is_multisite() ) { - $this->assertEquals( + $this->assertSame( '', $this->update_text_widget_with_raw_html( '' ) ); } else { - $this->assertEquals( + $this->assertSame( '', $this->update_text_widget_with_raw_html( '' ) ); @@ -1028,12 +1028,12 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $request->set_body_params( array( 'id' => 'text-1', + 'id_base' => 'text', 'instance' => array( 'raw' => array( 'text' => $html, ), ), - 'id_base' => 'text', ) ); $response = rest_get_server()->dispatch( $request ); @@ -1065,14 +1065,14 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $data = $this->remove_links( $data ); - $this->assertEquals( + $this->assertSame( array( 'id' => 'testwidget', + 'id_base' => 'testwidget', 'sidebar' => 'sidebar-1', - 'instance' => null, 'rendered' => '