diff --git a/tests/php/test-class-amp-theme-support.php b/tests/php/test-class-amp-theme-support.php index d166127dff9..475f4db55d7 100644 --- a/tests/php/test-class-amp-theme-support.php +++ b/tests/php/test-class-amp-theme-support.php @@ -1900,11 +1900,23 @@ public function test_prepare_response_for_validating_non_amp_page() { /** @return array */ public function get_data_to_test_prepare_response_for_validating_amp_page() { return [ - 'no-store' => [ - false, + 'no-store' => [ + 'args' => [ + AMP_Validation_Manager::VALIDATE_QUERY_VAR_NONCE => AMP_Validation_Manager::get_amp_validate_nonce(), + ], ], - 'store' => [ - true, + 'store' => [ + 'args' => [ + AMP_Validation_Manager::VALIDATE_QUERY_VAR_NONCE => AMP_Validation_Manager::get_amp_validate_nonce(), + AMP_Validation_Manager::VALIDATE_QUERY_VAR_CACHE => true, + ], + ], + 'store_but_omit_styleshets' => [ + 'args' => [ + AMP_Validation_Manager::VALIDATE_QUERY_VAR_NONCE => AMP_Validation_Manager::get_amp_validate_nonce(), + AMP_Validation_Manager::VALIDATE_QUERY_VAR_CACHE => true, + AMP_Validation_Manager::VALIDATE_QUERY_VAR_OMIT_STYLESHEETS => true, + ], ], ]; } @@ -1915,34 +1927,33 @@ public function get_data_to_test_prepare_response_for_validating_amp_page() { * @dataProvider get_data_to_test_prepare_response_for_validating_amp_page * @covers AMP_Theme_Support::prepare_response() * @covers AMP_Validation_Manager::send_validate_response() - * - * @param bool $store Whether to store results. */ - public function test_prepare_response_for_validating_amp_page( $store ) { + public function test_prepare_response_for_validating_amp_page( $args ) { wp_set_current_user( self::factory()->user->create( [ 'role' => 'administrator' ] ) ); $this->set_template_mode( AMP_Theme_Support::STANDARD_MODE_SLUG ); $this->go_to( '/' ); - $_GET[ AMP_Validation_Manager::VALIDATE_QUERY_VAR ] = [ - AMP_Validation_Manager::VALIDATE_QUERY_VAR_NONCE => AMP_Validation_Manager::get_amp_validate_nonce(), - ]; - if ( $store ) { - $_GET[ AMP_Validation_Manager::VALIDATE_QUERY_VAR ][ AMP_Validation_Manager::VALIDATE_QUERY_VAR_CACHE ] = 'true'; - } + $_GET[ AMP_Validation_Manager::VALIDATE_QUERY_VAR ] = $args; AMP_Validation_Manager::init_validate_request(); - $response = AMP_Theme_Support::prepare_response( '