Skip to content

Commit

Permalink
Fix builds after Gutenberg merged into core
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Oct 22, 2018
1 parent 9ddac9e commit 039ef47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev-lib
18 changes: 14 additions & 4 deletions tests/validation/test-class-amp-validation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +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":"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"}]}';
$source_json .= ',{"type":"core","name":"wp-includes","function":"shortcode_unautop"},{"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(
"<!--amp-source-stack $source_json-->",
Expand Down

0 comments on commit 039ef47

Please sign in to comment.