Esempio n. 1
0
 /**
  * Response getter
  *
  * @return Magento_Test_Response
  */
 public function getResponse()
 {
     if (!$this->_response) {
         $this->_response = new Magento_Test_Response();
         $this->_objectManager->addSharedInstance($this->_response, 'Mage_Core_Controller_Response_Http');
     }
     return $this->_response;
 }
Esempio n. 2
0
 /**
  * Set up config with fixture controllers directory scanner
  */
 protected function setUp()
 {
     $fixtureDir = __DIR__ . '/../../../_files/Controller/Webapi/';
     $directoryScanner = new \Zend\Code\Scanner\DirectoryScanner($fixtureDir);
     /** @var Mage_Core_Model_Cache $cache */
     $cache = $this->getMockBuilder('Mage_Core_Model_Cache')->disableOriginalConstructor()->getMock();
     /** @var Mage_Core_Model_App $app */
     $app = $this->getMockBuilder('Mage_Core_Model_App')->disableOriginalConstructor()->getMock();
     $appConfig = Mage::app()->getConfig();
     $objectManager = new Magento_Test_ObjectManager();
     /** @var Mage_Webapi_Helper_Config $helper */
     $helper = $objectManager->get('Mage_Webapi_Helper_Config');
     /** @var Mage_Webapi_Model_Config_Reader_Soap_ClassReflector $classReflector */
     $classReflector = $objectManager->get('Mage_Webapi_Model_Config_Reader_Soap_ClassReflector');
     $reader = new Mage_Webapi_Model_Config_Reader_Soap($classReflector, $appConfig, $cache);
     $reader->setDirectoryScanner($directoryScanner);
     $this->_config = new Mage_Webapi_Model_Config_Soap($reader, $helper, $app);
     $objectManager->addSharedInstance($this->_config, 'Mage_Webapi_Model_Config_Soap');
 }
Esempio n. 3
0
 /**
  * Set up config with fixture controllers directory scanner
  */
 protected function setUp()
 {
     $fixtureDir = __DIR__ . '/../../_files/Controller/AutoDiscover/';
     $directoryScanner = new \Zend\Code\Scanner\DirectoryScanner($fixtureDir);
     /** @var Mage_Core_Model_App $app */
     $app = $this->getMockBuilder('Mage_Core_Model_App')->disableOriginalConstructor()->getMock();
     $objectManager = new Magento_Test_ObjectManager();
     $this->_helper = $objectManager->get('Mage_Webapi_Helper_Config');
     $reader = $objectManager->get('Mage_Webapi_Model_Config_Reader_Soap');
     $reader->setDirectoryScanner($directoryScanner);
     $this->_config = new Mage_Webapi_Model_Config_Soap($reader, $this->_helper, $app);
     $objectManager->addSharedInstance($this->_config, 'Mage_Webapi_Model_Config_Soap');
     $wsdlFactory = new Mage_Webapi_Model_Soap_Wsdl_Factory($objectManager);
     $cache = $this->getMockBuilder('Mage_Core_Model_Cache')->disableOriginalConstructor()->getMock();
     $this->_autoDiscover = new Mage_Webapi_Model_Soap_AutoDiscover($this->_config, $wsdlFactory, $this->_helper, $cache);
     $this->_resourceName = 'vendorModuleB';
     $this->_resourceData = $this->_config->getResourceDataMerged($this->_resourceName, 'v1');
     $xml = $this->_autoDiscover->generate(array($this->_resourceName => $this->_resourceData), 'http://magento.host/api/soap');
     $this->_dom = new DOMDocument('1.0', 'utf-8');
     $this->_dom->loadXML($xml);
     $this->_xpath = new DOMXPath($this->_dom);
     $this->_xpath->registerNamespace(Wsdl::WSDL_NS, Wsdl::WSDL_NS_URI);
     parent::setUp();
 }