public function testAroundResultWithPluginDeveloperMode() { $this->registry->expects($this->once())->method('registry')->with('use_page_cache_plugin')->willReturn(true); $this->state->expects($this->once())->method('getMode')->willReturn(\Magento\Framework\App\State::MODE_DEVELOPER); $this->header->expects($this->any())->method('getFieldValue')->willReturnOnConsecutiveCalls('test', 'tag,tag2'); $this->response->expects($this->any())->method('setHeader')->withConsecutive(['X-Magento-Cache-Control', 'test'], ['X-Magento-Cache-Debug', 'MISS', true], ['X-Magento-Tags', 'tag,tag2,' . \Magento\PageCache\Model\Cache\Type::CACHE_TAG]); $this->response->expects($this->once())->method('clearHeader')->with('X-Magento-Tags'); $this->registry->expects($this->once())->method('registry')->with('use_page_cache_plugin')->will($this->returnValue(true)); $this->kernel->expects($this->once())->method('process')->with($this->response); $result = call_user_func($this->closure); $this->assertSame($result, $this->plugin->aroundRenderResult($this->subject, $this->closure, $this->response)); }