From ba94d9b67b1f6dc76e7494e2e147be36ec3e0aaa Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 18 Jul 2021 14:00:35 +0000 Subject: [PATCH] Tests: Use more appropriate assertions in `rest_sanitize_request_arg()` tests. This replaces instances of `assertSame( true, ... )` with `assertTrue()` to use native PHPUnit functionality. Follow-up to [38832]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51453 602fd350-edb4-49c9-b593-d223f7449a82 --- .../tests/rest-api/rest-controller.php | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-controller.php b/tests/phpunit/tests/rest-api/rest-controller.php index 827077c63f..5347ca15b7 100644 --- a/tests/phpunit/tests/rest-api/rest-controller.php +++ b/tests/phpunit/tests/rest-api/rest-controller.php @@ -111,36 +111,28 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase { ); // Check sanitize testing. - $this->assertSame( - false, + $this->assertFalse( rest_sanitize_request_arg( 'false', $this->request, 'someboolean' ) ); - $this->assertSame( - false, + $this->assertFalse( rest_sanitize_request_arg( '0', $this->request, 'someboolean' ) ); - $this->assertSame( - false, + $this->assertFalse( rest_sanitize_request_arg( 0, $this->request, 'someboolean' ) ); - $this->assertSame( - false, + $this->assertFalse( rest_sanitize_request_arg( 'FALSE', $this->request, 'someboolean' ) ); - $this->assertSame( - true, + $this->assertTrue( rest_sanitize_request_arg( 'true', $this->request, 'someboolean' ) ); - $this->assertSame( - true, + $this->assertTrue( rest_sanitize_request_arg( '1', $this->request, 'someboolean' ) ); - $this->assertSame( - true, + $this->assertTrue( rest_sanitize_request_arg( 1, $this->request, 'someboolean' ) ); - $this->assertSame( - true, + $this->assertTrue( rest_sanitize_request_arg( 'TRUE', $this->request, 'someboolean' ) );