/** * Tests that the default SOAP client request is done when not using NTLM authentication. * * @return void * @covers Zend\Soap\Client\DotNet::_doRequest */ public function testDefaultSoapClientRequestIsDoneWhenNotUsingNtlmAuthentication() { $soapClient = $this->getMock('Zend\\Soap\\Client\\Common', array('_doRequest'), array(array($this->client, '_doRequest'), null, array('location' => 'http://unit/test', 'uri' => 'http://unit/test'))); MockCallUserFunc::$mock = true; $this->client->setSoapClient($soapClient); $this->client->TestMethod(); $this->assertSame('http://unit/test#TestMethod', MockCallUserFunc::$params[3]); MockCallUserFunc::$mock = false; }
/** * Tests that the default SOAP client request is done when not using NTLM authentication. * * @return void * @covers Zend\Soap\Client\DotNet::_doRequest */ public function testDefaultSoapClientRequestIsDoneWhenNotUsingNtlmAuthentication() { $unitTest = $this; $soapClient = new Common(function (Common $client, $request, $location, $action, $version, $oneWay = null) use($unitTest) { $unitTest->assertEquals('http://unit/test#TestMethod', $action); $result = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' . '<s:Body>'; $result .= '<TestMethodResponse xmlns="http://unit/test">' . '<TestMethodResult>' . '<TestMethodResult><dummy></dummy></TestMethodResult>' . '</TestMethodResult>' . '</TestMethodResponse>'; $result .= '</s:Body>' . '</s:Envelope>'; return $result; }, null, array('location' => 'http://unit/test', 'uri' => 'http://unit/test')); $this->assertAttributeEquals(false, 'useNtlm', $this->client); $this->client->setOptions(array('authentication' => 'ntlm', 'login' => 'username', 'password' => 'testpass')); $this->client->setSoapClient($soapClient); $this->assertInstanceOf('stdClass', $this->client->TestMethod()); }