From b1363cc7fedf6ec7989844d6b51816bb82d233ed Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 24 Jan 2023 15:53:46 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `phpunit/tests/functions/wpRefererField.php`. While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names. This commit renames the `$echo` parameter to `$display` in `Tests_Functions_wpRefererField::test_wp_referer_field_should_respect_display_arg()`. Follow-up to [54420], [54929]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #56788. git-svn-id: https://develop.svn.wordpress.org/trunk@55130 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions/wpRefererField.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/tests/functions/wpRefererField.php b/tests/phpunit/tests/functions/wpRefererField.php index ca72d078f0..227fee71f4 100644 --- a/tests/phpunit/tests/functions/wpRefererField.php +++ b/tests/phpunit/tests/functions/wpRefererField.php @@ -30,26 +30,26 @@ class Tests_Functions_wpRefererField extends WP_UnitTestCase { } /** - * Tests that the echo argument is respected. + * Tests that the display argument is respected. * * @ticket 54106 * - * @dataProvider data_wp_referer_field_should_respect_echo_arg + * @dataProvider data_wp_referer_field_should_respect_display_arg * - * @param mixed $echo Whether to echo or return the referer field. + * @param mixed $display Whether to echo or return the referer field. */ - public function test_wp_referer_field_should_respect_echo_arg( $echo ) { - $actual = $echo ? get_echo( 'wp_referer_field' ) : wp_referer_field( false ); + public function test_wp_referer_field_should_respect_display_arg( $display ) { + $actual = $display ? get_echo( 'wp_referer_field' ) : wp_referer_field( false ); $this->assertSame( '', $actual ); } /** - * Data provider for test_wp_referer_field_should_respect_echo_arg(). + * Data provider for test_wp_referer_field_should_respect_display_arg(). * * @return array */ - public function data_wp_referer_field_should_respect_echo_arg() { + public function data_wp_referer_field_should_respect_display_arg() { return array( 'true' => array( true ), '(int) 1' => array( 1 ),