| | 1 | <?php |
| | 2 | |
| | 3 | /** |
| | 4 | * @group xmlrpc |
| | 5 | */ |
| | 6 | class Tests_XMLRPC_wp_setOptions extends WP_XMLRPC_UnitTestCase { |
| | 7 | |
| | 8 | /** |
| | 9 | * @ticket 22936 |
| | 10 | */ |
| | 11 | function test_set_option_no_escape_strings() { |
| | 12 | |
| | 13 | $this->make_user_by_role( 'administrator' ); |
| | 14 | $string_with_quote = "Mary's Lamb Shop"; |
| | 15 | $escaped_string_with_quote = esc_html( $string_with_quote ); // title is passed through esc_html() |
| | 16 | |
| | 17 | $result = $this->myxmlrpcserver->wp_setOptions( array( 1, 'administrator', 'administrator', array( "blog_title" => $string_with_quote, "users_can_register" => true ) ) ); |
| | 18 | |
| | 19 | $this->assertInternalType( 'array', $result ); |
| | 20 | $this->assertEquals( $escaped_string_with_quote, $result['blog_title']['value'] ); |
| | 21 | $this->assertEquals( true, $result['users_can_register']['value'] ); |
| | 22 | |
| | 23 | } |
| | 24 | |
| | 25 | } |