From e75cbd28f2e61d70ed061667b531d8cb1841778d Mon Sep 17 00:00:00 2001 From: Maks3w Date: Sat, 14 Dec 2013 20:17:59 +0100 Subject: [PATCH] Test rewrite for avoid test skip. Related #5592 --- tests/ZendTest/Soap/Client/DotNetTest.php | 47 +++++++++++++++-------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/tests/ZendTest/Soap/Client/DotNetTest.php b/tests/ZendTest/Soap/Client/DotNetTest.php index e46fac8bff1..7c9dfbe615c 100644 --- a/tests/ZendTest/Soap/Client/DotNetTest.php +++ b/tests/ZendTest/Soap/Client/DotNetTest.php @@ -10,6 +10,7 @@ namespace ZendTest\Soap\Client; use PHPUnit_Framework_TestCase; +use Zend\Soap\Client\Common; use Zend\Soap\Client\DotNet as DotNetClient; use ZendTest\Soap\TestAsset\MockCallUserFunc; @@ -92,24 +93,36 @@ public function testCurlClientRequestIsDoneWhenUsingNtlmAuthentication() */ public function testDefaultSoapClientRequestIsDoneWhenNotUsingNtlmAuthentication() { - if (version_compare(phpversion(), '5.5.6', '=') || version_compare(phpversion(), '5.5.7', '=')) { - $this->markTestSkipped('This test is incompatible with PHP 5.5.6-7 only, causes segfault.'); - } - - $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; + $unitTest = $this; + $soapClient = new Common( + function(Common $client, $request, $location, $action, $version, $oneWay = null) use ($unitTest) { + $unitTest->assertEquals('http://unit/test#TestMethod', $action); + $result = '' + . ''; + + $result .= '' + . '' + . '' + . '' + . ''; + + $result .= '' + . ''; + + 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->client->TestMethod(); - - $this->assertSame('http://unit/test#TestMethod', MockCallUserFunc::$params[3]); - - MockCallUserFunc::$mock = false; + $this->assertInstanceOf('stdClass', $this->client->TestMethod()); } /**