From d0f8d4ff70e6f0606203832f24584f91bfbb7e93 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 19 Feb 2022 12:40:48 +0000 Subject: [PATCH] Tests: Correct the order of expected and actual values in `wp_validate_boolean()` tests. This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct. Additionally, this commit moves the test function before the data provider, for consistency with other tests. Follow-up to [46159], [46224]. See #54725. git-svn-id: https://develop.svn.wordpress.org/trunk@52775 602fd350-edb4-49c9-b593-d223f7449a82 --- .../tests/functions/wpValidateBoolean.php | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/phpunit/tests/functions/wpValidateBoolean.php b/tests/phpunit/tests/functions/wpValidateBoolean.php index 785d1bc986..2355921bd3 100644 --- a/tests/phpunit/tests/functions/wpValidateBoolean.php +++ b/tests/phpunit/tests/functions/wpValidateBoolean.php @@ -7,6 +7,22 @@ * @covers ::wp_validate_boolean */ class Tests_Functions_wpValidateBoolean extends WP_UnitTestCase { + + /** + * Test wp_validate_boolean(). + * + * @dataProvider data_provider + * + * @param mixed $test_value + * @param bool $expected + * + * @ticket 30238 + * @ticket 39868 + */ + public function test_wp_validate_boolean( $test_value, $expected ) { + $this->assertSame( $expected, wp_validate_boolean( $test_value ) ); + } + /** * Provides test scenarios for all possible scenarios in wp_validate_boolean(). * @@ -41,19 +57,4 @@ class Tests_Functions_wpValidateBoolean extends WP_UnitTestCase { array( $std, true ), ); } - - /** - * Test wp_validate_boolean(). - * - * @dataProvider data_provider - * - * @param mixed $test_value - * @param bool $expected - * - * @ticket 30238 - * @ticket 39868 - */ - public function test_wp_validate_boolean( $test_value, $expected ) { - $this->assertSame( wp_validate_boolean( $test_value ), $expected ); - } }