Example #1
0
 /**
  * When calling a method that is not defined in the WSDL then throw SoapFault with expected message.
  */
 public function testWhenCallingAMethodThatIsNotDefinedInTheWSDLThenThrowSoapFaultWithExpectedMessage()
 {
     $client = new \SoapClient(APP_URL . '/wsdl', ['cache_wsdl' => WSDL_CACHE_NONE, 'location' => APP_URL]);
     try {
         $response = $client->getNonDefinedMethod();
         static::fail('was expecting a SoapFault, got [' . serialize($response) . '] instead');
     } catch (\SoapFault $e) {
         static::assertEquals('Function ("getNonDefinedMethod") is not a valid method for this service', $e->getMessage());
     }
 }