.
+ remove_action( 'wp_footer', 'the_block_template_skip_link' );
+
// Check action.
ob_start();
wp_footer();
diff --git a/tests/php/test-amp-bento-sanitizer.php b/tests/php/test-amp-bento-sanitizer.php
deleted file mode 100644
index 4b8d36ee9f4..00000000000
--- a/tests/php/test-amp-bento-sanitizer.php
+++ /dev/null
@@ -1,581 +0,0 @@
- [
- 'source' => '
-
-
-
-
-
-
-
- The following should have a green outline.
-
-
-
-
-
-
- Section 1
- Content in section 1.
-
-
- Section 2
- Content in section 2.
-
-
-
- Section 3
- Content in section 3.
-
-
-
-
-
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
- The following should have a green outline.
-
-
-
- Section 1
- Content in section 1.
-
-
- Section 2
- Content in section 2.
-
-
-
- Section 3
- Content in section 3.
-
-
-
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [],
- 'expect_prefer_bento' => true,
- ],
-
- 'non-amp-bento-component' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
-
-
- News flash!!!
-
-
-
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
-
-
-
-
-
-
- News flash!!!
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [],
- 'expect_prefer_bento' => true,
- ],
-
- 'both-amp-and-bento-components' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Saturday 11 April 2017 00.37
-
-
-
-
-
-
-
-
-
-
-
-
-
- News flash!!!
-
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
-
-
-
-
-
- Saturday 11 April 2017 00.37
-
-
-
-
-
-
-
-
-
-
-
-
- News flash!!!
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [],
- 'expect_prefer_bento' => true,
- ],
-
- 'bento-components-hidden-initially' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lightboxed content
-
-
-
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
-
-
- Lightboxed content
-
-
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [],
- 'expect_prefer_bento' => true,
- ],
-
- 'no-bento-components' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hello World!!
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
- Hello World!!
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [ AMP_Tag_And_Attribute_Sanitizer::DISALLOWED_TAG ],
- 'expect_prefer_bento' => false,
- ],
-
- 'bento-mathml' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
- The Quadratic Formula
-
-
- Inline formula
-
- This is an example of a formula,
-
- placed inline in the middle of a block of text.
-
-
-
- ',
- 'expected' => '
-
-
-
-
-
-
- The Quadratic Formula
-
-
- Inline formula
-
- This is an example of a formula,
-
- placed inline in the middle of a block of text.
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [],
- 'expect_prefer_bento' => true,
- ],
-
- 'bento-no-layout-available' => [
- 'source' => '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ',
- // Note: It's somewhat unexpected that the styles are still in the document since the element was removed.
- // But this is because the tree shaking happened before the tag-and-attribute sanitizer ran, so at the
- // time of tree shaking the bento-base-carousel element was still in the document.
- 'expected' => '
-
-
-
-
-
-
-
- ',
- 'sanitizer_args' => [],
- 'expected_error_codes' => [
- AMP_Tag_And_Attribute_Sanitizer::MISSING_LAYOUT_ATTRIBUTES,
- ],
- 'expect_prefer_bento' => true,
- ],
- ];
- }
-
- /**
- * Test that noscript elements get replaced with their children.
- *
- * @dataProvider get_sanitizer_data
- * @param string $source Source.
- * @param string $expected Expected.
- * @param array $sanitizer_args Sanitizer args.
- * @param array $expected_error_codes Expected error codes.
- * @param bool $expect_prefer_bento Whether expecting prefer_bento to be set.
- * @covers ::init()
- * @covers ::sanitize()
- * @covers ::has_light_shadow_dom()
- * @covers ::get_selector_conversion_mapping()
- * @covers ::adapt_layout_styles()
- * @covers ::get_bento_component_name_from_url()
- * @covers \AMP_Base_Sanitizer::set_layout()
- */
- public function test_sanitize( $source, $expected = null, $sanitizer_args = [], $expected_error_codes = [], $expect_prefer_bento = false ) {
- if ( null === $expected ) {
- $expected = $source;
- }
- $dom = Document::fromHtml( $source, Options::DEFAULTS );
-
- $validation_error_callback_arg = isset( $sanitizer_args['validation_error_callback'] ) ? $sanitizer_args['validation_error_callback'] : null;
-
- $actual_error_codes = [];
-
- $sanitizer_args['validation_error_callback'] = static function ( $error ) use ( &$actual_error_codes, $validation_error_callback_arg ) {
- $actual_error_codes[] = $error['code'];
-
- if ( $validation_error_callback_arg ) {
- return $validation_error_callback_arg();
- } else {
- return true;
- }
- };
-
- $sanitizer_args['use_document_element'] = true;
-
- $bento_sanitizer = new AMP_Bento_Sanitizer(
- $dom,
- $sanitizer_args
- );
-
- $tag_and_attribute_sanitizer = new AMP_Tag_And_Attribute_Sanitizer(
- $dom,
- array_merge(
- $sanitizer_args,
- [
- 'prefer_bento' => false, // Overridden by AMP_Base_Sanitizer.
- ]
- )
- );
-
- $sanitizers = [
- AMP_Bento_Sanitizer::class => $bento_sanitizer,
- AMP_Script_Sanitizer::class => new AMP_Script_Sanitizer(
- $dom,
- $sanitizer_args
- ),
- AMP_Style_Sanitizer::class => new AMP_Style_Sanitizer(
- $dom,
- $sanitizer_args
- ),
- AMP_Tag_And_Attribute_Sanitizer::class => $tag_and_attribute_sanitizer,
- ];
-
- foreach ( $sanitizers as $sanitizer ) {
- $sanitizer->init( $sanitizers );
- }
-
- $this->assertFalse( $tag_and_attribute_sanitizer->get_arg( 'prefer_bento' ) );
-
- foreach ( $sanitizers as $sanitizer ) {
- $sanitizer->sanitize();
- }
-
- $content = $dom->saveHTML( $dom->documentElement );
- $this->assertSimilarMarkup( $expected, $content );
-
- $this->assertSame( $expected_error_codes, $actual_error_codes );
- $this->assertSame( $expect_prefer_bento, $tag_and_attribute_sanitizer->get_arg( 'prefer_bento' ) );
- }
-}
diff --git a/tests/php/test-amp-helper-functions.php b/tests/php/test-amp-helper-functions.php
index 51720c8033f..a2bc5c9dd1e 100644
--- a/tests/php/test-amp-helper-functions.php
+++ b/tests/php/test-amp-helper-functions.php
@@ -1490,7 +1490,6 @@ public function test_amp_register_default_scripts_and_styles() {
global $wp_scripts, $wp_styles;
$wp_scripts = null;
$wp_styles = null;
- add_filter( 'amp_bento_enabled', '__return_false' );
$registered_script_srcs = [];
foreach ( wp_scripts()->registered as $handle => $dependency ) {
@@ -1502,7 +1501,25 @@ public function test_amp_register_default_scripts_and_styles() {
ksort( $registered_script_srcs );
// This allows us to ensure that we catch any version changes in scripts.
- $expected_scripts = [
+ $expected_scripts = $this->get_expected_registered_scripts();
+
+ ksort( $expected_scripts );
+ ksort( $registered_script_srcs );
+ // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
+ $this->assertEquals( $expected_scripts, $registered_script_srcs, "Actual fixture:\n" . var_export( $registered_script_srcs, true ) );
+
+ $this->assertTrue( wp_style_is( 'amp-default', 'registered' ) );
+ $this->assertTrue( wp_style_is( 'amp-icons', 'registered' ) );
+ $this->assertFalse( wp_style_is( 'amp-base-carousel', 'registered' ) );
+ }
+
+ /**
+ * Get expected registered scripts.
+ *
+ * @return array
+ */
+ private function get_expected_registered_scripts() {
+ return [
'amp-3d-gltf' => 'v0/amp-3d-gltf-0.1.js',
'amp-3q-player' => 'v0/amp-3q-player-0.1.js',
'amp-access' => 'v0/amp-access-0.1.js',
@@ -1595,7 +1612,6 @@ public function test_amp_register_default_scripts_and_styles() {
'amp-powr-player' => 'v0/amp-powr-player-0.1.js',
'amp-reach-player' => 'v0/amp-reach-player-0.1.js',
'amp-recaptcha-input' => 'v0/amp-recaptcha-input-0.1.js',
- 'amp-redbull-player' => 'v0/amp-redbull-player-0.1.js',
'amp-reddit' => 'v0/amp-reddit-0.1.js',
'amp-render' => 'v0/amp-render-1.0.js',
'amp-riddle-quiz' => 'v0/amp-riddle-quiz-0.1.js',
@@ -1640,235 +1656,9 @@ public function test_amp_register_default_scripts_and_styles() {
'amp-wordpress-embed' => 'v0/amp-wordpress-embed-1.0.js',
'amp-yotpo' => 'v0/amp-yotpo-0.1.js',
'amp-youtube' => 'v0/amp-youtube-0.1.js',
+ 'amp-slikeplayer' => 'v0/amp-slikeplayer-0.1.js',
+ 'amp-story-audio-sticker' => 'v0/amp-story-audio-sticker-0.1.js',
];
-
- ksort( $expected_scripts );
- ksort( $registered_script_srcs );
- // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
- $this->assertEquals( $expected_scripts, $registered_script_srcs, "Actual fixture:\n" . var_export( $registered_script_srcs, true ) );
-
- $this->assertTrue( wp_style_is( 'amp-default', 'registered' ) );
- $this->assertTrue( wp_style_is( 'amp-icons', 'registered' ) );
- $this->assertFalse( wp_style_is( 'amp-base-carousel', 'registered' ) );
- }
-
- /**
- * @covers ::amp_register_default_scripts()
- * @covers ::amp_register_default_styles()
- */
- public function test_amp_register_default_scripts_and_styles_with_bento() {
- global $wp_scripts, $wp_styles;
- $wp_scripts = null;
- $wp_styles = null;
- add_filter( 'amp_bento_enabled', '__return_true' );
-
- $registered_script_srcs = [];
- foreach ( wp_scripts()->registered as $handle => $dependency ) {
- if ( 'amp-' === substr( $handle, 0, 4 ) ) {
- $this->assertStringStartsWith( 'https://cdn.ampproject.org/', $dependency->src );
- $registered_script_srcs[ $handle ] = str_replace( 'https://cdn.ampproject.org/', '', $dependency->src );
- }
- }
- ksort( $registered_script_srcs );
-
- // This allows us to ensure that we catch any version changes in scripts.
- $expected_scripts = [
- 'amp-3d-gltf' => 'v0/amp-3d-gltf-0.1.js',
- 'amp-3q-player' => 'v0/amp-3q-player-0.1.js',
- 'amp-access' => 'v0/amp-access-0.1.js',
- 'amp-access-fewcents' => 'v0/amp-access-fewcents-0.1.js',
- 'amp-access-laterpay' => 'v0/amp-access-laterpay-0.2.js',
- 'amp-access-poool' => 'v0/amp-access-poool-0.1.js',
- 'amp-access-scroll' => 'v0/amp-access-scroll-0.1.js',
- 'amp-accordion' => 'v0/amp-accordion-1.0.js',
- 'amp-action-macro' => 'v0/amp-action-macro-0.1.js',
- 'amp-ad' => 'v0/amp-ad-0.1.js',
- 'amp-ad-custom' => 'v0/amp-ad-custom-0.1.js',
- 'amp-addthis' => 'v0/amp-addthis-0.1.js',
- 'amp-analytics' => 'v0/amp-analytics-0.1.js',
- 'amp-anim' => 'v0/amp-anim-0.1.js',
- 'amp-animation' => 'v0/amp-animation-0.1.js',
- 'amp-apester-media' => 'v0/amp-apester-media-0.1.js',
- 'amp-app-banner' => 'v0/amp-app-banner-0.1.js',
- 'amp-audio' => 'v0/amp-audio-1.0.js',
- 'amp-auto-ads' => 'v0/amp-auto-ads-0.1.js',
- 'amp-autocomplete' => 'v0/amp-autocomplete-0.1.js',
- 'amp-base-carousel' => 'v0/amp-base-carousel-1.0.js',
- 'amp-beopinion' => 'v0/amp-beopinion-0.1.js',
- 'amp-bind' => 'v0/amp-bind-0.1.js',
- 'amp-bodymovin-animation' => 'v0/amp-bodymovin-animation-0.1.js',
- 'amp-brid-player' => 'v0/amp-brid-player-0.1.js',
- 'amp-brightcove' => 'v0/amp-brightcove-1.0.js',
- 'amp-byside-content' => 'v0/amp-byside-content-0.1.js',
- 'amp-cache-url' => 'v0/amp-cache-url-0.1.js',
- 'amp-call-tracking' => 'v0/amp-call-tracking-0.1.js',
- 'amp-carousel' => 'v0/amp-carousel-0.2.js',
- 'amp-connatix-player' => 'v0/amp-connatix-player-0.1.js',
- 'amp-consent' => 'v0/amp-consent-0.1.js',
- 'amp-dailymotion' => 'v0/amp-dailymotion-1.0.js',
- 'amp-date-countdown' => 'v0/amp-date-countdown-1.0.js',
- 'amp-date-display' => 'v0/amp-date-display-1.0.js',
- 'amp-date-picker' => 'v0/amp-date-picker-0.1.js',
- 'amp-delight-player' => 'v0/amp-delight-player-0.1.js',
- 'amp-dynamic-css-classes' => 'v0/amp-dynamic-css-classes-0.1.js',
- 'amp-embedly-card' => 'v0/amp-embedly-card-1.0.js',
- 'amp-experiment' => 'v0/amp-experiment-0.1.js',
- 'amp-facebook' => 'v0/amp-facebook-1.0.js',
- 'amp-facebook-comments' => 'v0/amp-facebook-comments-0.1.js',
- 'amp-facebook-like' => 'v0/amp-facebook-like-0.1.js',
- 'amp-facebook-page' => 'v0/amp-facebook-page-0.1.js',
- 'amp-fit-text' => 'v0/amp-fit-text-1.0.js',
- 'amp-font' => 'v0/amp-font-0.1.js',
- 'amp-form' => 'v0/amp-form-0.1.js',
- 'amp-fx-collection' => 'v0/amp-fx-collection-0.1.js',
- 'amp-fx-flying-carpet' => 'v0/amp-fx-flying-carpet-0.1.js',
- 'amp-geo' => 'v0/amp-geo-0.1.js',
- 'amp-gist' => 'v0/amp-gist-0.1.js',
- 'amp-google-document-embed' => 'v0/amp-google-document-embed-0.1.js',
- 'amp-google-read-aloud-player' => 'v0/amp-google-read-aloud-player-0.1.js',
- 'amp-hulu' => 'v0/amp-hulu-0.1.js',
- 'amp-iframe' => 'v0/amp-iframe-1.0.js',
- 'amp-iframely' => 'v0/amp-iframely-0.1.js',
- 'amp-ima-video' => 'v0/amp-ima-video-0.1.js',
- 'amp-image-lightbox' => 'v0/amp-image-lightbox-0.1.js',
- 'amp-image-slider' => 'v0/amp-image-slider-0.1.js',
- 'amp-imgur' => 'v0/amp-imgur-0.1.js',
- 'amp-inline-gallery' => 'v0/amp-inline-gallery-1.0.js',
- 'amp-inputmask' => 'v0/amp-inputmask-0.1.js',
- 'amp-instagram' => 'v0/amp-instagram-1.0.js',
- 'amp-install-serviceworker' => 'v0/amp-install-serviceworker-0.1.js',
- 'amp-izlesene' => 'v0/amp-izlesene-0.1.js',
- 'amp-jwplayer' => 'v0/amp-jwplayer-0.1.js',
- 'amp-kaltura-player' => 'v0/amp-kaltura-player-0.1.js',
- 'amp-lightbox' => 'v0/amp-lightbox-1.0.js',
- 'amp-lightbox-gallery' => 'v0/amp-lightbox-gallery-1.0.js',
- 'amp-link-rewriter' => 'v0/amp-link-rewriter-0.1.js',
- 'amp-list' => 'v0/amp-list-0.1.js',
- 'amp-live-list' => 'v0/amp-live-list-0.1.js',
- 'amp-mathml' => 'v0/amp-mathml-1.0.js',
- 'amp-mega-menu' => 'v0/amp-mega-menu-0.1.js',
- 'amp-megaphone' => 'v0/amp-megaphone-0.1.js',
- 'amp-minute-media-player' => 'v0/amp-minute-media-player-0.1.js',
- 'amp-mowplayer' => 'v0/amp-mowplayer-0.1.js',
- 'amp-mustache' => 'v0/amp-mustache-0.2.js',
- 'amp-nested-menu' => 'v0/amp-nested-menu-0.1.js',
- 'amp-next-page' => 'v0/amp-next-page-1.0.js',
- 'amp-nexxtv-player' => 'v0/amp-nexxtv-player-0.1.js',
- 'amp-o2-player' => 'v0/amp-o2-player-0.1.js',
- 'amp-onetap-google' => 'v0/amp-onetap-google-0.1.js',
- 'amp-ooyala-player' => 'v0/amp-ooyala-player-0.1.js',
- 'amp-orientation-observer' => 'v0/amp-orientation-observer-0.1.js',
- 'amp-pan-zoom' => 'v0/amp-pan-zoom-0.1.js',
- 'amp-pinterest' => 'v0/amp-pinterest-0.1.js',
- 'amp-playbuzz' => 'v0/amp-playbuzz-0.1.js',
- 'amp-position-observer' => 'v0/amp-position-observer-0.1.js',
- 'amp-powr-player' => 'v0/amp-powr-player-0.1.js',
- 'amp-reach-player' => 'v0/amp-reach-player-0.1.js',
- 'amp-recaptcha-input' => 'v0/amp-recaptcha-input-0.1.js',
- 'amp-redbull-player' => 'v0/amp-redbull-player-0.1.js',
- 'amp-reddit' => 'v0/amp-reddit-0.1.js',
- 'amp-render' => 'v0/amp-render-1.0.js',
- 'amp-riddle-quiz' => 'v0/amp-riddle-quiz-0.1.js',
- 'amp-runtime' => 'v0.js',
- 'amp-script' => 'v0/amp-script-0.1.js',
- 'amp-selector' => 'v0/amp-selector-1.0.js',
- 'amp-shadow' => 'shadow-v0.js',
- 'amp-sidebar' => 'v0/amp-sidebar-1.0.js',
- 'amp-skimlinks' => 'v0/amp-skimlinks-0.1.js',
- 'amp-smartlinks' => 'v0/amp-smartlinks-0.1.js',
- 'amp-social-share' => 'v0/amp-social-share-1.0.js',
- 'amp-soundcloud' => 'v0/amp-soundcloud-1.0.js',
- 'amp-springboard-player' => 'v0/amp-springboard-player-0.1.js',
- 'amp-sticky-ad' => 'v0/amp-sticky-ad-1.0.js',
- 'amp-story' => 'v0/amp-story-1.0.js',
- 'amp-story-360' => 'v0/amp-story-360-0.1.js',
- 'amp-story-auto-ads' => 'v0/amp-story-auto-ads-0.1.js',
- 'amp-story-auto-analytics' => 'v0/amp-story-auto-analytics-0.1.js',
- 'amp-story-captions' => 'v0/amp-story-captions-0.1.js',
- 'amp-story-interactive' => 'v0/amp-story-interactive-0.1.js',
- 'amp-story-panning-media' => 'v0/amp-story-panning-media-0.1.js',
- 'amp-story-player' => 'v0/amp-story-player-0.1.js',
- 'amp-story-shopping' => 'v0/amp-story-shopping-0.1.js',
- 'amp-story-subscriptions' => 'v0/amp-story-subscriptions-0.1.js',
- 'amp-stream-gallery' => 'v0/amp-stream-gallery-1.0.js',
- 'amp-subscriptions' => 'v0/amp-subscriptions-0.1.js',
- 'amp-subscriptions-google' => 'v0/amp-subscriptions-google-0.1.js',
- 'amp-tiktok' => 'v0/amp-tiktok-0.1.js',
- 'amp-timeago' => 'v0/amp-timeago-1.0.js',
- 'amp-truncate-text' => 'v0/amp-truncate-text-0.1.js',
- 'amp-twitter' => 'v0/amp-twitter-1.0.js',
- 'amp-user-notification' => 'v0/amp-user-notification-0.1.js',
- 'amp-video' => 'v0/amp-video-1.0.js',
- 'amp-video-docking' => 'v0/amp-video-docking-0.1.js',
- 'amp-video-iframe' => 'v0/amp-video-iframe-1.0.js',
- 'amp-vimeo' => 'v0/amp-vimeo-1.0.js',
- 'amp-vine' => 'v0/amp-vine-0.1.js',
- 'amp-viqeo-player' => 'v0/amp-viqeo-player-0.1.js',
- 'amp-vk' => 'v0/amp-vk-0.1.js',
- 'amp-web-push' => 'v0/amp-web-push-0.1.js',
- 'amp-wistia-player' => 'v0/amp-wistia-player-0.1.js',
- 'amp-wordpress-embed' => 'v0/amp-wordpress-embed-1.0.js',
- 'amp-yotpo' => 'v0/amp-yotpo-0.1.js',
- 'amp-youtube' => 'v0/amp-youtube-1.0.js',
- ];
-
- ksort( $expected_scripts );
- ksort( $registered_script_srcs );
- // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
- $this->assertEquals( $expected_scripts, $registered_script_srcs, "Actual fixture:\n" . var_export( $registered_script_srcs, true ) );
-
- $bundled_styles = [ 'amp-default', 'amp-icons' ];
- foreach ( $bundled_styles as $bundled_style ) {
- $this->assertTrue( wp_style_is( $bundled_style, 'registered' ) );
- }
- $registered_style_srcs = [];
- foreach ( wp_styles()->registered as $handle => $dependency ) {
- if ( in_array( $handle, $bundled_styles, true ) ) {
- continue;
- }
-
- if ( 'amp-' === substr( $handle, 0, 4 ) ) {
- $this->assertStringStartsWith( 'https://cdn.ampproject.org/', $dependency->src );
- $registered_style_srcs[ $handle ] = str_replace( 'https://cdn.ampproject.org/', '', $dependency->src );
- }
- }
- ksort( $registered_style_srcs );
-
- // This allows us to ensure that we catch any version changes in styles.
- $expected_styles = [
- 'amp-accordion' => 'v0/amp-accordion-1.0.css',
- 'amp-base-carousel' => 'v0/amp-base-carousel-1.0.css',
- 'amp-brightcove' => 'v0/amp-brightcove-1.0.css',
- 'amp-dailymotion' => 'v0/amp-dailymotion-1.0.css',
- 'amp-date-countdown' => 'v0/amp-date-countdown-1.0.css',
- 'amp-date-display' => 'v0/amp-date-display-1.0.css',
- 'amp-embedly-card' => 'v0/amp-embedly-card-1.0.css',
- 'amp-facebook' => 'v0/amp-facebook-1.0.css',
- 'amp-fit-text' => 'v0/amp-fit-text-1.0.css',
- 'amp-iframe' => 'v0/amp-iframe-1.0.css',
- 'amp-inline-gallery' => 'v0/amp-inline-gallery-1.0.css',
- 'amp-instagram' => 'v0/amp-instagram-1.0.css',
- 'amp-lightbox' => 'v0/amp-lightbox-1.0.css',
- 'amp-lightbox-gallery' => 'v0/amp-lightbox-gallery-1.0.css',
- 'amp-mathml' => 'v0/amp-mathml-1.0.css',
- 'amp-selector' => 'v0/amp-selector-1.0.css',
- 'amp-sidebar' => 'v0/amp-sidebar-1.0.css',
- 'amp-social-share' => 'v0/amp-social-share-1.0.css',
- 'amp-soundcloud' => 'v0/amp-soundcloud-1.0.css',
- 'amp-stream-gallery' => 'v0/amp-stream-gallery-1.0.css',
- 'amp-timeago' => 'v0/amp-timeago-1.0.css',
- 'amp-twitter' => 'v0/amp-twitter-1.0.css',
- 'amp-video' => 'v0/amp-video-1.0.css',
- 'amp-video-iframe' => 'v0/amp-video-iframe-1.0.css',
- 'amp-vimeo' => 'v0/amp-vimeo-1.0.css',
- 'amp-wordpress-embed' => 'v0/amp-wordpress-embed-1.0.css',
- 'amp-youtube' => 'v0/amp-youtube-1.0.css',
- ];
-
- ksort( $expected_styles );
- ksort( $registered_style_srcs );
- // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
- $this->assertEquals( $expected_styles, $registered_style_srcs, "Actual fixture:\n" . var_export( $registered_style_srcs, true ) );
}
/**
diff --git a/tests/php/test-amp-script-sanitizer.php b/tests/php/test-amp-script-sanitizer.php
index 070e7ac2c01..72a6c3689fc 100644
--- a/tests/php/test-amp-script-sanitizer.php
+++ b/tests/php/test-amp-script-sanitizer.php
@@ -501,7 +501,6 @@ static function( $preempt, $request, $url ) {
$dom,
[
'use_document_element' => true,
- 'prefer_bento' => false, // Overridden by AMP_Script_Sanitizer when there is a kept script.
]
),
];
@@ -633,15 +632,10 @@ function ( Element $element ) {
$this->assertStringContainsString( 'body:after{', $css_text );
}
- // Verify that prefer_bento got set.
+ // Get registered scripts.
$scripts = $sanitizers[ AMP_Tag_And_Attribute_Sanitizer::class ]->get_scripts();
- if ( 3 === $level ) {
- $this->assertArrayHasKey( Extension::FACEBOOK_PAGE, $scripts );
- $this->assertArrayNotHasKey( Extension::FACEBOOK, $scripts );
- } else {
- $this->assertArrayHasKey( Extension::FACEBOOK_PAGE, $scripts );
- $this->assertArrayNotHasKey( Extension::FACEBOOK, $scripts );
- }
+ $this->assertArrayHasKey( Extension::FACEBOOK_PAGE, $scripts );
+ $this->assertArrayNotHasKey( Extension::FACEBOOK, $scripts );
}
/** @return array */
diff --git a/tests/php/test-amp-style-sanitizer.php b/tests/php/test-amp-style-sanitizer.php
index 537149fd4d9..7145218c473 100644
--- a/tests/php/test-amp-style-sanitizer.php
+++ b/tests/php/test-amp-style-sanitizer.php
@@ -1637,20 +1637,6 @@ public function get_attribute_selector_data() {
'.stateful' => false,
],
],
- 'bento_accordion_with_id' => [
- '
-
-
- Section 1
- Content in section 1.
-
-
- ',
- [
- '#my-accordion' => true,
- 'amp-accordion#my-accordion' => true,
- ],
- ],
'amp_replacement_elements_with_id' => [
'
diff --git a/tests/php/test-class-amp-theme-support.php b/tests/php/test-class-amp-theme-support.php
index b150436a8d0..05d6bbcef6f 100644
--- a/tests/php/test-class-amp-theme-support.php
+++ b/tests/php/test-class-amp-theme-support.php
@@ -1846,54 +1846,6 @@ public function test_prepare_response_in_forced_dev_mode() {
$this->assertStringNotContainsString( 'set_template_mode( AMP_Theme_Support::STANDARD_MODE_SLUG );
-
- add_filter( 'amp_bento_enabled', '__return_true' );
- wp();
-
- $html = AMP_Theme_Support::prepare_response( $this->get_original_html() );
- $this->assertStringContainsString( '', $html );
- $this->assertStringContainsString( 'amp-facebook-1.0', $html ); // As opposed to amp-facebook-page-0.1, since Bento is enabled.
- }
-
- /**
- * Test prepare_response when Bento is enabled and in dev mode.
- *
- * @covers AMP_Theme_Support::prepare_response()
- */
- public function test_prepare_response_in_bento_with_dev_mode() {
- $this->set_template_mode( AMP_Theme_Support::STANDARD_MODE_SLUG );
-
- add_filter( 'amp_dev_mode_enabled', '__return_true' );
- add_filter( 'amp_bento_enabled', '__return_true' );
- wp();
-
- $html = AMP_Theme_Support::prepare_response( $this->get_original_html() );
- $this->assertStringContainsString( '', $html );
- $this->assertStringContainsString( 'amp-facebook-1.0', $html ); // As opposed to amp-facebook-page-0.1, since Bento is enabled.
- }
-
- /**
- * Test prepare_response when Bento is not enabled.
- *
- * @covers AMP_Theme_Support::prepare_response()
- */
- public function test_prepare_response_without_bento() {
- $this->set_template_mode( AMP_Theme_Support::STANDARD_MODE_SLUG );
-
- wp();
-
- $html = AMP_Theme_Support::prepare_response( $this->get_original_html() );
- $this->assertStringNotContainsString( 'AMP.toggleExperiment("bento", true);', $html );
- $this->assertStringContainsString( 'amp-facebook-page-0.1', $html ); // As opposed to amp-facebook-page-1.0, since Bento is not enabled.
- }
-
/** @return array */
public function get_data_to_test_prepare_response_standard_mode_non_amp() {
return [
diff --git a/tests/php/test-tag-and-attribute-sanitizer.php b/tests/php/test-tag-and-attribute-sanitizer.php
index 4a077f2d9a3..202777cb7f5 100644
--- a/tests/php/test-tag-and-attribute-sanitizer.php
+++ b/tests/php/test-tag-and-attribute-sanitizer.php
@@ -194,14 +194,6 @@ public function get_body_data() {
[ 'amp-facebook-comments' ],
],
- 'amp-facebook-comments_bento' => [
- '',
- null, // No change.
- [ 'amp-facebook' ],
- [],
- [ 'prefer_bento' => true ],
- ],
-
'amp-facebook-comments_missing_required_attribute' => [
'',
'',
@@ -220,28 +212,12 @@ public function get_body_data() {
[ 'amp-facebook-like' ],
],
- 'amp-facebook-like_bento' => [
- '',
- null, // No change.
- [ 'amp-facebook' ],
- [],
- [ 'prefer_bento' => true ],
- ],
-
'amp-facebook-page' => [
'',
null, // No change.
[ 'amp-facebook-page' ],
],
- 'amp-facebook-page_bento' => [
- '',
- null, // No change.
- [ 'amp-facebook' ],
- [],
- [ 'prefer_bento' => true ],
- ],
-
'amp-facebook-like_missing_required_attribute' => [
'',
'',
@@ -2994,20 +2970,6 @@ class="slide"
[ 'amp-sidebar', 'amp-list', 'amp-mustache' ],
],
- 'amp-redbull-player' => [
- '
-
- ',
- null,
- [ 'amp-redbull-player' ],
- ],
-
'mustache_templates_with_variable_attrs' => [
'