Make WordPress Core

Ticket #45066: 45066.hotfix.2.diff

File 45066.hotfix.2.diff, 1.6 KB (added by whyisjake, 5 years ago)
  • tests/phpunit/tests/dependencies/scripts.php

     
    680680                global $wp_scripts;
    681681
    682682                wp_default_scripts( $wp_scripts );
     683                wp_default_packages( $wp_scripts );
    683684
    684685                $wp_scripts->base_url  = '';
    685686                $wp_scripts->do_concat = true;
     
    705706                global $wp_scripts;
    706707
    707708                wp_default_scripts( $wp_scripts );
     709                wp_default_packages( $wp_scripts );
    708710
    709711                $wp_scripts->base_url  = '';
    710712                $wp_scripts->do_concat = true;
     
    739741                $wp_scripts->base_url  = '';
    740742                $wp_scripts->do_concat = true;
    741743
    742                 $expected_tail = "<script type='text/javascript' src='/customize-dependency.js'></script>\n";
     744                $expected_tail  = "<script type='text/javascript' src='/customize-dependency.js'></script>\n";
    743745                $expected_tail .= "<script type='text/javascript'>\n";
    744746                $expected_tail .= "tryCustomizeDependency()\n";
    745747                $expected_tail .= "</script>\n";
     
    748750                wp_enqueue_script( $handle, '/customize-dependency.js', array( 'customize-controls' ), null );
    749751                wp_add_inline_script( $handle, 'tryCustomizeDependency()' );
    750752
    751                 // Open a buffer to get the output of `wp_print_scripts`.
    752                 ob_start();
    753753                wp_print_scripts();
    754                 $print_scripts = ob_get_clean();
     754                $print_scripts = get_echo( '_print_scripts' );
    755755
    756756                $tail = substr( $print_scripts, strrpos( $print_scripts, "<script type='text/javascript' src='/customize-dependency.js'>" ) );
    757757                $this->assertEquals( $expected_tail, $tail );