mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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
This commit is contained in:
parent
f28e3d0b88
commit
ba94d9b67b
@ -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' )
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user