diff --git tests/phpunit/tests/formatting/SanitizeOption.php tests/phpunit/tests/formatting/SanitizeOption.php
new file mode 100644
index 0000000..cf0973b
-
|
+
|
|
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @group formatting |
| 5 | */ |
| 6 | class Tests_Formatting_SanitizeOption extends WP_UnitTestCase { |
| 7 | // #27942 |
| 8 | function test_sanitize_option() { |
| 9 | $options = array( |
| 10 | 'blogname' => array( |
| 11 | '<Hello><World>', |
| 12 | 'This is a regular blog name', |
| 13 | '<span><em>Some HTML tags</em></span>' |
| 14 | ), |
| 15 | ); |
| 16 | |
| 17 | $expected = array( |
| 18 | 'blogname' => array( |
| 19 | '<Hello><World>', |
| 20 | 'This is a regular blog name', |
| 21 | '<span><em>Some HTML tags</em></span>' |
| 22 | ), |
| 23 | ); |
| 24 | |
| 25 | foreach ( $options as $option_name => $values ) { |
| 26 | foreach ( $values as $key => $value ) { |
| 27 | $this->assertEquals( $expected[ $option_name ][ $key ], sanitize_option( $option_name, $value ) ); |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |