Example #1
0
 /**
  * Test Soap server construction with WSDL cache disabling.
  */
 public function testConstructDisableWsdlCache()
 {
     /** Mock getConfig method to return false. */
     $this->_storeMock->expects($this->any())->method('getConfig')->will($this->returnValue(false));
     /** Create Soap server object. */
     $server = new Mage_Webapi_Model_Soap_Server($this->_applicationMock, $this->_requestMock, $this->_domDocumentFactory);
     $server->initWsdlCache();
     /** Assert soap wsdl caching option was disabled after soap server initialization. */
     $this->assertFalse((bool) ini_get('soap.wsdl_cache_enabled'), 'WSDL caching was not disabled.');
 }
Example #2
0
 /**
  * Test fault method with Mage_Webapi_Model_Soap_Fault.
  */
 public function testWebapiSoapFault()
 {
     /** Mock Webapi Soap fault. */
     $apiFault = $this->getMockBuilder('Mage_Webapi_Model_Soap_Fault')->disableOriginalConstructor()->getMock();
     /** Assert mocked fault toXml method will be executed once. */
     $apiFault->expects($this->once())->method('toXml');
     $this->_soapServer->fault($apiFault);
 }
Example #3
0
 /**
  * Initialize SOAP Server.
  *
  * @return Mage_Webapi_Model_Soap_Server
  */
 protected function _initSoapServer()
 {
     $this->_soapServer->initWsdlCache();
     $this->_soapServer->setWSDL($this->_soapServer->generateUri(true))->setEncoding($this->_soapServer->getApiCharset())->setSoapVersion(SOAP_1_2)->setClassmap($this->_apiConfig->getTypeToClassMap());
     use_soap_error_handler(false);
     // TODO: Headers are not available at this point.
     // $this->_soapHandler->setRequestHeaders($this->_getRequestHeaders());
     $this->_soapServer->setReturnResponse(true)->setObject($this->_soapHandler);
     return $this->_soapServer;
 }