/** * Mocks an NTLM SOAP request. * * @return void */ private function mockNtlmRequest() { $headers = array('Content-Type' => 'text/xml; charset=utf-8', 'Method' => 'POST', 'SOAPAction' => '"http://unithost/test#TestMethod"', 'User-Agent' => 'PHP-SOAP-CURL'); $response = "HTTP/1.1 200 OK\n" . "Cache-Control: private\n" . "Content-Type: text/xml; charset=utf-8\n" . "\n\n" . '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' . '<s:Body>' . '<TestMethodResponse xmlns="http://unit/test">' . '<TestMethodResult>' . '<TestMethodResult><dummy></dummy></TestMethodResult>' . '</TestMethodResult>' . '</TestMethodResponse>' . '</s:Body>' . '</s:Envelope>'; $this->mockCurlClient(); $this->curlClient->expects($this->once())->method('connect')->with('unithost', 80); $this->curlClient->expects($this->once())->method('read')->will($this->returnValue($response)); $this->curlClient->expects($this->any())->method('write')->with('POST', $this->isInstanceOf('Zend\\Uri\\Http'), 1.1, $headers, $this->stringContains('<SOAP-ENV')); $this->client->setOptions(array('authentication' => 'ntlm', 'login' => 'username', 'password' => 'testpass')); }