From 3e111d979928aebc89c529d06e41f320bad5f49e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Sep 2020 07:36:33 +0000 Subject: [PATCH] Tests: Replace a few more instances of `assertEquals()` with `assertSame()`. These were previously missed due to incorrect capitalization. Follow-up to [48937], [48939]. See #38266. git-svn-id: https://develop.svn.wordpress.org/trunk@48940 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/admin/includesScreen.php | 2 +- tests/phpunit/tests/comment/getCommentsPagesCount.php | 2 +- tests/phpunit/tests/formatting/JSEscape.php | 4 ++-- tests/phpunit/tests/general/wpError.php | 2 +- tests/phpunit/tests/rest-api/rest-plugins-controller.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/admin/includesScreen.php b/tests/phpunit/tests/admin/includesScreen.php index 16e4c68d8b..c482ae3711 100644 --- a/tests/phpunit/tests/admin/includesScreen.php +++ b/tests/phpunit/tests/admin/includesScreen.php @@ -377,7 +377,7 @@ class Tests_Admin_includesScreen extends WP_UnitTestCase { // Add help tabs. $screen->add_help_tab( $tab_1_args ); - $this->assertequals( $screen->get_help_tab( $tab_1 ), $tab_1_args ); + $this->assertSame( $screen->get_help_tab( $tab_1 ), $tab_1_args ); $screen->add_help_tab( $tab_2_args ); $this->assertSame( $screen->get_help_tab( $tab_2 ), $tab_2_args ); diff --git a/tests/phpunit/tests/comment/getCommentsPagesCount.php b/tests/phpunit/tests/comment/getCommentsPagesCount.php index 38a1328f51..adf755a329 100644 --- a/tests/phpunit/tests/comment/getCommentsPagesCount.php +++ b/tests/phpunit/tests/comment/getCommentsPagesCount.php @@ -58,7 +58,7 @@ class Tests_Comment_GetCommentsPagesCount extends WP_UnitTestCase { $this->assertSame( 0, get_comment_pages_count( $comments, 10, true ) ); $this->assertSame( 0, get_comment_pages_count( $comments, 5 ) ); $this->assertSame( 0, get_comment_pages_count( $comments ) ); - $this->assertequals( 0, get_comment_pages_count( null, 1 ) ); + $this->assertSame( 0, get_comment_pages_count( null, 1 ) ); } /** diff --git a/tests/phpunit/tests/formatting/JSEscape.php b/tests/phpunit/tests/formatting/JSEscape.php index 1b5c73ce1b..4dcb064819 100644 --- a/tests/phpunit/tests/formatting/JSEscape.php +++ b/tests/phpunit/tests/formatting/JSEscape.php @@ -35,12 +35,12 @@ class Tests_Formatting_JSEscape extends WP_UnitTestCase { function test_js_no_carriage_return() { $out = esc_js( "foo\rbar\nbaz\r" ); // \r is stripped. - $this->assertequals( "foobar\\nbaz", $out ); + $this->assertSame( "foobar\\nbaz", $out ); } function test_js_escape_rn() { $out = esc_js( "foo\r\nbar\nbaz\r\n" ); // \r is stripped. - $this->assertequals( "foo\\nbar\\nbaz\\n", $out ); + $this->assertSame( "foo\\nbar\\nbaz\\n", $out ); } } diff --git a/tests/phpunit/tests/general/wpError.php b/tests/phpunit/tests/general/wpError.php index 16daca9889..f7b234c0ce 100644 --- a/tests/phpunit/tests/general/wpError.php +++ b/tests/phpunit/tests/general/wpError.php @@ -202,7 +202,7 @@ class Tests_WP_Error extends WP_UnitTestCase { $this->wp_error->add( 'code', 'message' ); $this->wp_error->add( 'code', 'message2' ); - $this->assertequalSets( array( 'message', 'message2' ), $this->wp_error->get_error_messages( 'code' ) ); + $this->assertSameSets( array( 'message', 'message2' ), $this->wp_error->get_error_messages( 'code' ) ); } /** diff --git a/tests/phpunit/tests/rest-api/rest-plugins-controller.php b/tests/phpunit/tests/rest-api/rest-plugins-controller.php index 79194543a9..22b2f0a40c 100644 --- a/tests/phpunit/tests/rest-api/rest-plugins-controller.php +++ b/tests/phpunit/tests/rest-api/rest-plugins-controller.php @@ -218,7 +218,7 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase { public function test_get_items_insufficient_permissions() { wp_set_current_user( self::$subscriber_id ); $response = rest_do_request( self::BASE ); - $this->assertequals( 403, $response->get_status() ); + $this->assertSame( 403, $response->get_status() ); } /**