diff --git a/codecov.yml b/codecov.yml index cbce7411..abffc2b3 100644 --- a/codecov.yml +++ b/codecov.yml @@ -36,8 +36,8 @@ ignore: - 'inc/templates' - 'inc/class-blurhash.php' - 'inc/default-filters.php' - - 'packages/editor/src/preferencesModal/preference-base-option' - - 'packages/editor/src/preferencesModal/preferences-modal' - - 'packages/editor/src/preferencesModal/preferences-modal-section' - - 'packages/editor/src/preferencesModal/preferences-modal-tabs' - - 'packages/editor/src/preferencesModal/tabs' + - 'packages/editor/src/preferences-modal/preference-base-option' + - 'packages/editor/src/preferences-modal/preferences-modal' + - 'packages/editor/src/preferences-modal/preferences-modal-section' + - 'packages/editor/src/preferences-modal/preferences-modal-tabs' + - 'packages/editor/src/preferences-modal/tabs' diff --git a/inc/class-cross-origin-isolation.php b/inc/class-cross-origin-isolation.php deleted file mode 100644 index 8cf2e2da..00000000 --- a/inc/class-cross-origin-isolation.php +++ /dev/null @@ -1,282 +0,0 @@ -needs_isolation() ) { - header( 'Cross-Origin-Opener-Policy: same-origin' ); - header( "Cross-Origin-Embedder-Policy: $coep" ); - } - - ob_start( [ $this, 'replace_in_dom' ] ); - } - - /** - * Filters the HTML link tag of an enqueued style. - * - * @since 1.6.0 - * - * @param mixed $tag The link tag for the enqueued style. - * @param string $handle The style's registered handle. - * @param string $href The stylesheet's source URL. - * @return string|mixed - */ - public function filter_style_loader_tag( $tag, string $handle, string $href ) { - return $this->add_attribute( $tag, 'href', $href ); - } - - /** - * Filters the HTML script tag of an enqueued script. - * - * @since 1.6.0 - * - * @param mixed $tag The ` + + + +HTML; + + $expected = << + + + + + + + + + + + +HTML; + + $actual = add_crossorigin_attributes( $html ); + + $this->assertSame( $expected, $actual ); + } + + /** + * @covers \MediaExperiments\override_media_templates + */ + public function test_override_media_templates(): void { + if ( ! function_exists( '\wp_print_media_templates' ) ) { + require_once ABSPATH . WPINC . '/media-template.php'; + } + + override_media_templates(); + + ob_start(); + do_action( 'admin_footer' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound + $output = ob_get_clean(); + + $this->assertStringContainsString( '