diff --git tests/phpunit/tests/formatting/WPSlash.php tests/phpunit/tests/formatting/WPSlash.php
new file mode 100644
index 000000000..01c97e8e0
|
-
|
+
|
|
| | 1 | <?php |
| | 2 | |
| | 3 | /** |
| | 4 | * @group formatting |
| | 5 | */ |
| | 6 | class Tests_Formatting_WPSlash extends WP_UnitTestCase { |
| | 7 | |
| | 8 | /** |
| | 9 | * @dataProvider data_wp_slash |
| | 10 | * |
| | 11 | * @ticket 42195 |
| | 12 | * |
| | 13 | * @param string $value |
| | 14 | * @param string $expected |
| | 15 | */ |
| | 16 | public function test_wp_slash_with( $value, $expected ) { |
| | 17 | $this->assertEquals( $expected, wp_slash( $value ) ); |
| | 18 | } |
| | 19 | |
| | 20 | /** |
| | 21 | * Data provider for test_wp_slash(). |
| | 22 | * |
| | 23 | * @return array { |
| | 24 | * @type array { |
| | 25 | * @type mixed $value The value passed to wp_slash(). |
| | 26 | * @type string $expected The expected output of wp_slash(). |
| | 27 | * } |
| | 28 | * } |
| | 29 | */ |
| | 30 | public function data_wp_slash() { |
| | 31 | return array( |
| | 32 | array( 123, '123' ), |
| | 33 | array( 123.4, '123.4' ), |
| | 34 | array( true, '1' ), |
| | 35 | array( false, '0' ), |
| | 36 | ); |
| | 37 | } |
| | 38 | |
| | 39 | |
| | 40 | } |
| | 41 | No newline at end of file |