VCR\Util\SoapClient::setLibraryHook PHP Méthode

setLibraryHook() public méthode

Sets the SOAP library hook which is used to intercept SOAP requests.
public setLibraryHook ( SoapHook $hook )
$hook VCR\LibraryHooks\SoapHook SOAP library hook to use when intercepting SOAP requests.
    public function setLibraryHook(SoapHook $hook)
    {
        $this->soapHook = $hook;
    }

Usage Example

Exemple #1
0
 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);
 }