/** * Test sendResponse method with Http Not Acceptable error exception during messages rendering. */ public function testSendResponseRenderMessagesHttpNotAcceptable() { /** Init logic exception. */ $logicException = new LogicException('Message', Mage_Webapi_Exception::HTTP_NOT_ACCEPTABLE); /** Mock renderer to throw LogicException in getMimeType method. */ $this->_rendererMock->expects($this->any())->method('getMimeType')->will($this->throwException($logicException)); /** Assert renderException method will be executed once with specified parameters. */ $this->_errorProcessorMock->expects($this->once())->method('renderException')->with($logicException, Mage_Webapi_Exception::HTTP_NOT_ACCEPTABLE); /** Set exception to Rest response to get in to the _renderMessages method. */ $this->_responseRest->setException(new Mage_Webapi_Exception('Message.', 400)); $this->_responseRest->sendResponse(); }