Skip to content

Commit

Permalink
Ensure metadata is populated to test prepare_response after #6233
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed May 28, 2021
1 parent 9587b13 commit e285b24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/php/test-class-amp-theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function tearDown() {
$wp_styles = null;
$wp_admin_bar = null;

$this->set_private_property( AMP_Theme_Support::class, 'metadata', null );

parent::tearDown();
unset( $GLOBALS['show_admin_bar'] );
AMP_Validation_Manager::$is_validate_request = false;
Expand Down Expand Up @@ -1632,6 +1634,8 @@ static function ( $url ) {
// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript, WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
$original_html = $this->get_original_html();

$this->set_private_property( AMP_Theme_Support::class, 'metadata', amp_get_schemaorg_metadata() );

$call_prepare_response = static function() use ( $original_html ) {
AMP_HTTP::$headers_sent = [];
AMP_Validation_Manager::$validation_results = [];
Expand Down

0 comments on commit e285b24

Please sign in to comment.