Docs: Correct comments in tests/formatting/WPSlash.php per the documentation standards.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48442 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-11 22:50:36 +00:00
parent 4d964a8cf2
commit accf884aac

View File

@ -6,14 +6,14 @@
class Tests_Formatting_WPSlash extends WP_UnitTestCase { class Tests_Formatting_WPSlash extends WP_UnitTestCase {
/** /**
* @dataProvider data_wp_slash
*
* @ticket 42195 * @ticket 42195
* *
* @dataProvider data_wp_slash
*
* @param string $value * @param string $value
* @param string $expected * @param string $expected
*/ */
public function test_wp_slash_with( $value, $expected ) { public function test_wp_slash( $value, $expected ) {
$this->assertSame( $expected, wp_slash( $value ) ); $this->assertSame( $expected, wp_slash( $value ) );
} }
@ -59,8 +59,8 @@ class Tests_Formatting_WPSlash extends WP_UnitTestCase {
$new = "I can\'t see, isn\'t that it?"; $new = "I can\'t see, isn\'t that it?";
$this->assertEquals( $new, wp_slash( $old ) ); $this->assertEquals( $new, wp_slash( $old ) );
$this->assertEquals( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) ); $this->assertEquals( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) );
$this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array $this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
$this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed $this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
} }
/** /**
@ -78,9 +78,9 @@ class Tests_Formatting_WPSlash extends WP_UnitTestCase {
'c' => 4, 'c' => 4,
'd' => 'foo', 'd' => 'foo',
); );
$arr['e'] = $arr; // Add a sub-array $arr['e'] = $arr; // Add a sub-array.
$this->assertEquals( $arr, wp_slash( $arr ) ); // Keyed array $this->assertEquals( $arr, wp_slash( $arr ) ); // Keyed array.
$this->assertEquals( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed $this->assertEquals( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
$obj = new stdClass; $obj = new stdClass;
foreach ( $arr as $k => $v ) { foreach ( $arr as $k => $v ) {
@ -96,8 +96,8 @@ class Tests_Formatting_WPSlash extends WP_UnitTestCase {
$old = 'single\\slash double\\\\slash triple\\\\\\slash'; $old = 'single\\slash double\\\\slash triple\\\\\\slash';
$new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash'; $new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash';
$this->assertEquals( $new, wp_slash( $old ) ); $this->assertEquals( $new, wp_slash( $old ) );
$this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array $this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
$this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed $this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
} }
} }