Test Soap Services with PHPUnit

时间:2016-08-31 17:55:21

标签: php web-services soap phpunit

I'm trying to write tests for a Web Service. I need to monitor whether the service is online and returning data that makes sense (correct domain, length, format, etc...).

Unfortunatelly, I was unable to test using PHPUnit. It fails whenever it reaches the soap call line.

I've searched the web and found that I should mock the service. But that wouldn't solve my problem. I need to test the service - not the client.

Is it possible to allow remote soap calls from phpunit?

public function testByEmployee() {
    $client = new SoapClient('services_int.xml');
    $client->methodCall();
    $this->assertTrue(true);
}

This test fails.

0 个答案:

没有答案