/** * {@inheritdoc} */ public function sendResponse() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'sendResponse'); if (!$pluginInfo) { return parent::sendResponse(); } else { return $this->___callPlugins('sendResponse', func_get_args(), $pluginInfo); } }
/** * @param bool $isDeveloper * @param int $setBodyCalls * * @dataProvider catchExceptionDataProvider */ public function testCatchException($isDeveloper, $setBodyCalls) { $bootstrap = $this->getMock('Magento\\Framework\\App\\Bootstrap', [], [], '', false); $exception = $this->getMock('Exception', [], [], '', false); $this->responseMock->expects($this->once())->method('setHttpResponseCode')->with(404); $bootstrap->expects($this->once())->method('isDeveloperMode')->will($this->returnValue($isDeveloper)); $this->responseMock->expects($this->exactly($setBodyCalls))->method('setBody'); $this->responseMock->expects($this->once())->method('sendResponse'); $this->model->catchException($bootstrap, $exception); }
/** * {@inheritdoc} */ public function catchException(App\Bootstrap $bootstrap, \Exception $exception) { $this->response->setHttpResponseCode(404); if ($bootstrap->isDeveloperMode()) { $this->response->setHeader('Content-Type', 'text/plain'); $this->response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString()); } $this->response->sendResponse(); return true; }
/** * {@inheritdoc} */ public function catchException(App\Bootstrap $bootstrap, \Exception $exception) { $this->_response->setHttpResponseCode(404); $this->_response->sendHeaders(); return true; }
/** * {@inheritdoc} */ public function getContent() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getContent'); if (!$pluginInfo) { return parent::getContent(); } else { return $this->___callPlugins('getContent', func_get_args(), $pluginInfo); } }