/** * Test if the response headers of the plugin - set within the plugin action / dispatch - were set into the parent response. * * @dataProvider responseHeadersDataprovider * @test */ public function evaluateSetHeaderIntoParent($message, $input, $expected) { $this->pluginImplementation->expects($this->any())->method('buildPluginRequest')->will($this->returnValue($this->mockActionRequest)); $parentResponse = new Response(); $this->_setHeadersIntoResponse($parentResponse, $input['parent']); $this->mockControllerContext->expects($this->any())->method('getResponse')->will($this->returnValue($parentResponse)); $this->mockDispatcher->expects($this->any())->method('dispatch')->will($this->returnCallback(function ($request, $response) use($input) { $this->_setHeadersIntoResponse($response, $input['plugin']); })); $this->pluginImplementation->evaluate(); foreach ($expected as $expectedKey => $expectedValue) { $this->assertEquals($expectedValue, (string) $parentResponse->getHeaders()->get($expectedKey), $message); } }