public function testGetAndSetResponse() { $this->assertInstanceOf('Zend_Controller_Response_Abstract', $this->_output->getResponse()); $response = $this->getMock('Zend_Controller_Response_Abstract'); $this->_output->setResponse($response); $this->assertSame($response, $this->_output->getResponse()); }
public function testGetAndSetResponse() { $this->assertInstanceOf('Zend\\Http\\PhpEnvironment\\Response', $this->_output->getResponse()); $response = $this->getMock('Magento\\Framework\\App\\Response\\Http', null, [], '', false); $this->_output->setResponse($response); $this->assertSame($response, $this->_output->getResponse()); }
protected function setUp() { $this->_response = $this->getMockBuilder('\\Magento\\Framework\\App\\Response\\Http')->setMethods(array('canSendHeaders', 'sendHeaders'))->disableOriginalConstructor()->getMock(); $this->_response->expects($this->any())->method('canSendHeaders')->will($this->returnValue(true)); $this->_request = $this->getMock('\\Magento\\Framework\\App\\Request\\Http', array('getHeader'), array(), '', false); $this->_request->expects($this->any())->method('getHeader')->with('User-Agent')->will($this->returnValue('Mozilla/5.0 with FirePHP/1.6')); $this->_output = new \Magento\Framework\Profiler\Driver\Standard\Output\Firebug(); $this->_output->setResponse($this->_response); $this->_output->setRequest($this->_request); }
protected function setUp() { $this->markTestSkipped('Remove it when MAGETWO-33495 is done.'); $this->_response = $this->getMockBuilder('\\Magento\\Framework\\App\\Response\\Http')->setMethods(['sendHeaders'])->disableOriginalConstructor()->getMock(); $this->_request = $this->getMock('\\Magento\\Framework\\App\\Request\\Http', ['getHeader'], [], '', false); $header = \Zend\Http\Header\GenericHeader::fromString('User-Agent: Mozilla/5.0 FirePHP/1.6'); $this->_request->expects($this->any())->method('getHeader')->with('User-Agent')->will($this->returnValue($header)); $this->_output = new \Magento\Framework\Profiler\Driver\Standard\Output\Firebug(); $this->_output->setResponse($this->_response); $this->_output->setRequest($this->_request); }