From b8533a19b8c27f1ab9b1839d401a1a263199d3cb Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Wed, 18 Sep 2019 22:29:53 +0000 Subject: [PATCH] Accesibility: Replace wp-a11y.js with @wordpress/a11y package Continuation of [46167]. This fixes the tests that ended up broken following the previous commit. We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure webpack to load is an external. Props, garrett-eclipse Fixes #45066 git-svn-id: https://develop.svn.wordpress.org/trunk@46169 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/dependencies/scripts.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index e077398d6e..93bf76c0fe 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -680,6 +680,7 @@ JS; global $wp_scripts; wp_default_scripts( $wp_scripts ); + wp_default_packages( $wp_scripts ); $wp_scripts->base_url = ''; $wp_scripts->do_concat = true; @@ -705,6 +706,7 @@ JS; global $wp_scripts; wp_default_scripts( $wp_scripts ); + wp_default_packages( $wp_scripts ); $wp_scripts->base_url = ''; $wp_scripts->do_concat = true; @@ -739,7 +741,7 @@ JS; $wp_scripts->base_url = ''; $wp_scripts->do_concat = true; - $expected_tail = "\n"; + $expected_tail = "\n"; $expected_tail .= "\n"; @@ -748,10 +750,8 @@ JS; wp_enqueue_script( $handle, '/customize-dependency.js', array( 'customize-controls' ), null ); wp_add_inline_script( $handle, 'tryCustomizeDependency()' ); - // Open a buffer to get the output of `wp_print_scripts`. - ob_start(); wp_print_scripts(); - $print_scripts = ob_get_clean(); + $print_scripts = get_echo( '_print_scripts' ); $tail = substr( $print_scripts, strrpos( $print_scripts, "