Requests will be intercepted if the library hook is enabled.
public __doRequest ( string $request, string $location, string $action, integer $version, integer $one_way ) : string | ||
$request | string | The XML SOAP request. |
$location | string | The URL to request. |
$action | string | The SOAP action. |
$version | integer | The SOAP version. |
$one_way | integer | If one_way is set to 1, this method returns nothing. Use this where a response is not expected. |
return | string | The XML SOAP response. |
public function testDoRequestExpectingException() { $exception = '\\LogicException'; $hook = $this->getLibraryHookMock(true); $hook->expects($this->once())->method('doRequest')->will($this->throwException(new \LogicException('hook not enabled.'))); $client = new SoapClient(self::WSDL); $client->setLibraryHook($hook); $this->setExpectedException($exception); $client->__doRequest('Knorx ist groß', self::WSDL, self::ACTION, SOAP_1_2); }