Remove redundant calls to var_export() in test_wc_query_string_form_fields()
It is not necessary to use the $message parameter of assertEquals() to output the value of $actual_html, as PHPUnit already output this variable value in case of error.
This commit is contained in:
parent
391570bc73
commit
e21430703c
|
@ -124,22 +124,22 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case {
|
|||
public function test_wc_query_string_form_fields() {
|
||||
$actual_html = wc_query_string_form_fields( '?test=1', array(), '', true );
|
||||
$expected_html = '<input type="hidden" name="test" value="1" />';
|
||||
$this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
$this->assertEquals( $expected_html, $actual_html );
|
||||
|
||||
$actual_html = wc_query_string_form_fields( '?test=1&test2=something', array(), '', true );
|
||||
$expected_html = '<input type="hidden" name="test" value="1" /><input type="hidden" name="test2" value="something" />';
|
||||
$this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
$this->assertEquals( $expected_html, $actual_html );
|
||||
|
||||
$actual_html = wc_query_string_form_fields( '?test.something=something', array(), '', true );
|
||||
$expected_html = '<input type="hidden" name="test.something" value="something" />';
|
||||
$this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
$this->assertEquals( $expected_html, $actual_html );
|
||||
|
||||
$actual_html = wc_query_string_form_fields( '?test+something=something', array(), '', true );
|
||||
$expected_html = '<input type="hidden" name="test+something" value="something" />';
|
||||
$this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
$this->assertEquals( $expected_html, $actual_html );
|
||||
|
||||
$actual_html = wc_query_string_form_fields( '?test%20something=something', array(), '', true );
|
||||
$expected_html = '<input type="hidden" name="test%20something" value="something" />';
|
||||
$this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
$this->assertEquals( $expected_html, $actual_html );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue