Make WordPress Core

Ticket #37877: 37877.diff

File 37877.diff, 852 bytes (added by swissspidy, 8 years ago)
  • tests/phpunit/tests/dependencies/scripts.php

    diff --git tests/phpunit/tests/dependencies/scripts.php tests/phpunit/tests/dependencies/scripts.php
    index efe5a7b..62691c0 100644
    class Tests_Dependencies_Scripts extends WP_UnitTestCase { 
    724724
    725725                $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
    726726        }
     727
     728        /**
     729         * @ticket 37877
     730         */
     731        function test_wp_add_inline_script_single_quotes() {
     732                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     733                wp_add_inline_script( 'test-example', '"Aujourd\'hui";' );
     734
     735                $expected = "<script type='text/javascript' src='http://example.com'></script>\n";
     736                $expected .= "<script type='text/javascript'>\n\"Aujourd'hui\";\n</script>\n";
     737
     738                $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
     739        }
    727740}