/** * Test get method with wrong Renderer class. */ public function testGetWithWrongRendererClass() { $acceptTypes = array('application/json'); $availableRenders = $this->_createConfigElementForRenders(); /** Mock application config getNode method to return the list of renders. */ $this->_applicationMock->expects($this->once())->method('getNode')->will($this->returnValue($availableRenders)); /** Mock request getAcceptTypes method to return specified value. */ $this->_requestMock->expects($this->once())->method('getAcceptTypes')->will($this->returnValue($acceptTypes)); /** Mock object to return Varien_Object */ $this->_objectManagerMock->expects($this->once())->method('get')->with('Mage_Webapi_Controller_Response_Rest_Renderer_Json')->will($this->returnValue(new Varien_Object())); $this->setExpectedException('LogicException', 'The renderer must implement "Mage_Webapi_Controller_Response_Rest_RendererInterface".'); $this->_factory->get(); }