Ejemplo n.º 1
0
 /**
  * Process Webapi SOAP fault.
  *
  * @param Mage_Webapi_Model_Soap_Fault|Exception|string $fault
  * @param string $code
  * @return SoapFault|string
  */
 public function fault($fault = null, $code = null)
 {
     if ($fault instanceof Mage_Webapi_Model_Soap_Fault) {
         return $fault->toXml($this->_application->isDeveloperMode());
     } else {
         return parent::fault($fault, $code);
     }
 }
Ejemplo n.º 2
0
 public function fault($fault = null, $code = 'Receiver')
 {
     $this->exception = is_string($fault) ? new \Exception($fault) : $fault;
     return parent::fault($fault, $code);
 }
Ejemplo n.º 3
0
 /**
  * @group ZF-3958
  */
 public function testFaultWithIntegerFailureCodeDoesNotBreakClassSoapFault()
 {
     $server = new Server();
     $fault = $server->fault("Faultmessage!", 5000);
     $this->assertTrue($fault instanceof \SOAPFault);
 }
Ejemplo n.º 4
0
 public function testGetOriginalCaughtException()
 {
     $server = new Server();
     $fault = $server->fault(new \Exception('test'));
     $exception = $server->getException();
     $this->assertInstanceOf('\\Exception', $exception);
     $this->assertEquals('test', $exception->getMessage());
     $this->assertInstanceOf('\\SoapFault', $fault);
     $this->assertEquals('Unknown error', $fault->getMessage());
 }