/** * Initialize dependencies. * * @param Mage_Webapi_Controller_Request_Factory $requestFactory * @param Mage_Webapi_Controller_Response_Factory $responseFactory * @param Mage_Core_Model_Factory_Helper $helperFactory */ public function __construct(Mage_Webapi_Controller_Request_Factory $requestFactory, Mage_Webapi_Controller_Response_Factory $responseFactory, Mage_Core_Model_Factory_Helper $helperFactory) { $this->_helperFactory = $helperFactory; $this->_translationHelper = $this->_helperFactory->get('Mage_Webapi_Helper_Data'); $this->_request = $requestFactory->get(); $this->_response = $responseFactory->get(); }
/** * Test get method with wrong API type. */ public function testGetWithWrongApiType() { $wrongApiType = 'Wrong SOAP'; /**Mock front controller determine api method to return wrong api type */ $this->_apiFrontController->expects($this->once())->method('determineApiType')->will($this->returnValue($wrongApiType)); $this->setExpectedException('LogicException', sprintf('There is no corresponding response class for the "%s" API type.', $wrongApiType)); $this->_factory->get(); }