From e2df4ed864e5ad2358e239ec264a844d757c6ea2 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 22 Oct 2018 15:36:19 -0700 Subject: [PATCH] Fix builds after Gutenberg merged into core --- dev-lib | 2 +- .../test-class-amp-validation-manager.php | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dev-lib b/dev-lib index 32430f45c03..41298476955 160000 --- a/dev-lib +++ b/dev-lib @@ -1 +1 @@ -Subproject commit 32430f45c03ce40b3755f7c2c0b03c8857154d59 +Subproject commit 412984769558627b1afe128bb505537ea4c6044d diff --git a/tests/validation/test-class-amp-validation-manager.php b/tests/validation/test-class-amp-validation-manager.php index 5f497691c99..87a02b3ed2f 100644 --- a/tests/validation/test-class-amp-validation-manager.php +++ b/tests/validation/test-class-amp-validation-manager.php @@ -929,10 +929,21 @@ public function test_decorate_shortcode_and_filter_source() { $source_json = '{"hook":"the_content","filter":true,"sources":[{"type":"core","name":"wp-includes","function":"WP_Embed::run_shortcode"},{"type":"core","name":"wp-includes","function":"WP_Embed::autoembed"}'; if ( 9 === has_filter( 'the_content', 'do_blocks' ) ) { - $source_json .= ',{"type":"plugin","name":"gutenberg","function":"gutenberg_wpautop"},{"type":"plugin","name":"amp","function":"AMP_Validation_Manager::add_block_source_comments"},{"type":"plugin","name":"gutenberg","function":"do_blocks"},{"type":"core","name":"wp-includes","function":"wptexturize"},{"type":"core","name":"wp-includes","function":"shortcode_unautop"}'; - } else { - $source_json .= ',{"type":"core","name":"wp-includes","function":"wptexturize"},{"type":"core","name":"wp-includes","function":"wpautop"},{"type":"core","name":"wp-includes","function":"shortcode_unautop"}'; + if ( function_exists( 'gutenberg_wpautop' ) ) { + $source_json .= ',{"type":"plugin","name":"gutenberg","function":"gutenberg_wpautop"}'; + } + $source_json .= ',{"type":"plugin","name":"amp","function":"AMP_Validation_Manager::add_block_source_comments"}'; + $source_json .= sprintf( + ',{"type":"%s","name":"%s","function":"do_blocks"}', + function_exists( 'gutenberg_wpautop' ) ? 'plugin' : 'core', + function_exists( 'gutenberg_wpautop' ) ? 'gutenberg' : 'wp-includes' + ); + } + $source_json .= ',{"type":"core","name":"wp-includes","function":"wptexturize"}'; + if ( ! function_exists( 'gutenberg_wpautop' ) ) { + $source_json .= ',{"type":"core","name":"wp-includes","function":"wpautop"}'; } + $source_json .= ',{"type":"core","name":"wp-includes","function":"shortcode_unautop"}'; $source_json .= ',{"type":"core","name":"wp-includes","function":"prepend_attachment"},{"type":"core","name":"wp-includes","function":"wp_make_content_images_responsive"},{"type":"core","name":"wp-includes","function":"capital_P_dangit"},{"type":"core","name":"wp-includes","function":"do_shortcode"},{"type":"core","name":"wp-includes","function":"convert_smilies"}]}'; $expected_content = implode( '', array(