Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Test rewrite for avoid test skip. Related #5592 #5613

Closed
wants to merge 1 commit into from

2 participants

@Maks3w
Collaborator

No description provided.

@weierophinney weierophinney added this to the 2.2.6 milestone
@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/5613' into develop
Forward port #5613
2126bf2
@weierophinney weierophinney self-assigned this
@samsonasik samsonasik referenced this pull request from a commit in samsonasik/zf2
@samsonasik samsonasik fix cs from #5613 42f510f
@samsonasik samsonasik referenced this pull request
Merged

fix cs from #5613 #5899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 14, 2013
  1. @Maks3w
This page is out of date. Refresh to see the latest.
Showing with 30 additions and 17 deletions.
  1. +30 −17 tests/ZendTest/Soap/Client/DotNetTest.php
View
47 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 = '<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->client->TestMethod();
-
- $this->assertSame('http://unit/test#TestMethod', MockCallUserFunc::$params[3]);
-
- MockCallUserFunc::$mock = false;
+ $this->assertInstanceOf('stdClass', $this->client->TestMethod());
}
/**
Something went wrong with that request. Please try again.