Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/7476'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 4, 2015
2 parents 364510b + e19f76b commit 8c0b6a1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 35 deletions.
6 changes: 3 additions & 3 deletions test/AutoDiscover/OnlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function testNestedObjectArrayResponse()
$client = new Client($wsdl);
$ret = $client->request($b);

$this->assertTrue(is_array($ret));
$this->assertInternalType('array', $ret);
$this->assertEquals(1, count($ret));
$this->assertTrue(is_array($ret[0]->baz));
$this->assertInternalType('array', $ret[0]->baz);
$this->assertEquals(3, count($ret[0]->baz));

$baz = $ret[0]->baz;
Expand All @@ -60,7 +60,7 @@ public function testObjectResponse()
$client = new Client($wsdl);
$ret = $client->request("test", "test");

$this->assertTrue(($ret instanceof \stdClass));
$this->assertInstanceOf('stdClass', $ret);
$this->assertEquals("test", $ret->foo);
$this->assertEquals("test", $ret->bar);
}
Expand Down
5 changes: 3 additions & 2 deletions test/AutoDiscoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,9 @@ public function testComplexTypesThatAreUsedMultipleTimesAreRecoginzedOnce()
'//wsdl:part[@name="test" and @type="tns:AutoDiscoverTestClass1"]',
'AutoDiscoverTestClass1 appears once or more than once in the message parts section.'
);
$this->assertTrue(
$nodes->length >= 1,
$this->assertGreaterThanOrEqual(
1,
$nodes->length,
'AutoDiscoverTestClass1 appears once or more than once in the message parts section.'
);

Expand Down
21 changes: 11 additions & 10 deletions test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testSetOptions()
*************************************************************/
$client = new Client();

$this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
$this->assertEquals(array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2), $client->getOptions());

$ctx = stream_context_create();

Expand Down Expand Up @@ -83,14 +83,14 @@ public function testSetOptions()
);

$client->setOptions($nonWSDLOptions);
$this->assertTrue($client->getOptions() == $nonWSDLOptions);
$this->assertEquals($nonWSDLOptions, $client->getOptions());

/*************************************************************
* ------ Test non-WSDL mode options -----------------------------
*************************************************************/
$client1 = new Client();

$this->assertTrue($client1->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
$this->assertEquals(array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2), $client1->getOptions());

$wsdlOptions = array('soap_version' => SOAP_1_1,
'wsdl' => __DIR__.'/TestAsset/wsdl_example.wsdl',
Expand All @@ -116,14 +116,14 @@ public function testSetOptions()
);

$client1->setOptions($wsdlOptions);
$this->assertTrue($client1->getOptions() == $wsdlOptions);
$this->assertEquals($wsdlOptions, $client1->getOptions());
}

public function testGetOptions()
{
$client = new Client();

$this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
$this->assertEquals(array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2), $client->getOptions());

$typeMap = array(
array(
Expand Down Expand Up @@ -167,7 +167,7 @@ public function testGetOptions()
);

$client->setOptions($options);
$this->assertTrue($client->getOptions() == $options);
$this->assertEquals($options, $client->getOptions());
}

/**
Expand Down Expand Up @@ -270,10 +270,11 @@ public function testGetFunctions()

$client = new Client\Local($server, __DIR__ . '/TestAsset/wsdl_example.wsdl');

$this->assertTrue($client->getFunctions() == array('string testFunc()',
'string testFunc2(string $who)',
'string testFunc3(string $who, int $when)',
'string testFunc4()'));
$expected = array('string testFunc()',
'string testFunc2(string $who)',
'string testFunc3(string $who, int $when)',
'string testFunc4()');
$this->assertEquals($expected, $client->getFunctions());
}

public function testGetTypes()
Expand Down
26 changes: 13 additions & 13 deletions test/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testSetOptions()
{
$server = new Server();

$this->assertTrue($server->getOptions() == array('soap_version' => SOAP_1_2));
$this->assertEquals(array('soap_version' => SOAP_1_2), $server->getOptions());

$options = array('soap_version' => SOAP_1_1,
'actor' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
Expand All @@ -44,7 +44,7 @@ public function testSetOptions()
);
$server->setOptions($options);

$this->assertTrue($server->getOptions() == $options);
$this->assertEquals($options, $server->getOptions());
}

public function testSetOptionsViaSecondConstructorArgument()
Expand All @@ -61,7 +61,7 @@ public function testSetOptionsViaSecondConstructorArgument()
);
$server = new Server(null, $options);

$this->assertTrue($server->getOptions() == $options);
$this->assertEquals($options, $server->getOptions());
}

/**
Expand Down Expand Up @@ -91,14 +91,14 @@ public function testGetOptions()
{
$server = new Server();

$this->assertTrue($server->getOptions() == array('soap_version' => SOAP_1_2));
$this->assertEquals(array('soap_version' => SOAP_1_2), $server->getOptions());

$options = array('soap_version' => SOAP_1_1,
'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php'
);
$server->setOptions($options);

$this->assertTrue($server->getOptions() == $options);
$this->assertEquals($options, $server->getOptions());
}

public function testEncoding()
Expand Down Expand Up @@ -186,7 +186,7 @@ public function testSetClassmap()

$this->assertNull($server->getClassmap());
$server->setClassmap($classmap);
$this->assertTrue($classmap == $server->getClassmap());
$this->assertSame($classmap, $server->getClassmap());
}

public function testSetClassmapThrowsExceptionOnBogusStringParameter()
Expand Down Expand Up @@ -214,7 +214,7 @@ public function testGetClassmap()

$this->assertNull($server->getClassmap());
$server->setClassmap($classmap);
$this->assertTrue($classmap == $server->getClassmap());
$this->assertSame($classmap, $server->getClassmap());
}

public function testSetWsdl()
Expand Down Expand Up @@ -423,7 +423,7 @@ public function testGetFunctions()
'\ZendTest\Soap\TestAsset\TestFunc5',
'\ZendTest\Soap\TestAsset\TestFunc6'
);
$this->assertTrue($server->getFunctions() == $allAddedFunctions);
$this->assertEquals($allAddedFunctions, $server->getFunctions());
}

public function testGetFunctionsWithClassAttached()
Expand Down Expand Up @@ -723,7 +723,7 @@ public function testFaultWithTextMessage()
$server = new Server();
$fault = $server->fault('FaultMessage!');

$this->assertTrue($fault instanceof \SoapFault);
$this->assertInstanceOf('SoapFault', $fault);
$this->assertContains('FaultMessage!', $fault->getMessage());
}

Expand All @@ -732,7 +732,7 @@ public function testFaultWithUnregisteredException()
$server = new Server();
$fault = $server->fault(new \Exception('MyException'));

$this->assertTrue($fault instanceof \SoapFault);
$this->assertInstanceOf('SoapFault', $fault);
$this->assertContains('Unknown error', $fault->getMessage());
$this->assertNotContains('MyException', $fault->getMessage());
}
Expand All @@ -743,7 +743,7 @@ public function testFaultWithRegisteredException()
$server->registerFaultException('\Zend\Soap\Exception\RuntimeException');
$server->registerFaultException('\Zend\Soap\Exception\InvalidArgumentException');
$fault = $server->fault(new \Zend\Soap\Exception\RuntimeException('MyException'));
$this->assertTrue($fault instanceof \SoapFault);
$this->assertInstanceOf('SoapFault', $fault);
$this->assertNotContains('Unknown error', $fault->getMessage());
$this->assertContains('MyException', $fault->getMessage());
}
Expand All @@ -764,7 +764,7 @@ public function testFaultWithIntegerFailureCodeDoesNotBreakClassSoapFault()
$server = new Server();
$fault = $server->fault("FaultMessage!", 5000);

$this->assertTrue($fault instanceof \SoapFault);
$this->assertInstanceOf('SoapFault', $fault);
}

/**
Expand Down Expand Up @@ -903,7 +903,7 @@ public function testHandleUsesProperRequestParameter()
{
$server = new \ZendTest\Soap\TestAsset\MockServer();
$r = $server->handle(new \DOMDocument('1.0', 'UTF-8'));
$this->assertTrue(is_string($server->mockSoapServer->handle[0]));
$this->assertInternalType('string', $server->mockSoapServer->handle[0]);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/Wsdl/CompositeStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function testCompositeApiAddingStragiesToTypes()
$bookStrategy = $strategy->getStrategyOfType('Book');
$cookieStrategy = $strategy->getStrategyOfType('Cookie');

$this->assertTrue($bookStrategy instanceof ArrayOfTypeComplex);
$this->assertTrue($cookieStrategy instanceof ArrayOfTypeSequence);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex', $bookStrategy);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeSequence', $cookieStrategy);
}

public function testConstructorTypeMapSyntax()
Expand All @@ -51,8 +51,8 @@ public function testConstructorTypeMapSyntax()
$bookStrategy = $strategy->getStrategyOfType('Book');
$cookieStrategy = $strategy->getStrategyOfType('Cookie');

$this->assertTrue($bookStrategy instanceof ArrayOfTypeComplex);
$this->assertTrue($cookieStrategy instanceof ArrayOfTypeSequence);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex', $bookStrategy);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeSequence', $cookieStrategy);
}

public function testCompositeThrowsExceptionOnInvalidType()
Expand Down
6 changes: 3 additions & 3 deletions test/WsdlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,18 +622,18 @@ public function testGetType()
public function testGetComplexTypeBasedOnStrategiesBackwardsCompabilityBoolean()
{
$this->assertEquals('tns:WsdlTestClass', $this->wsdl->getType('\ZendTest\Soap\TestAsset\WsdlTestClass'));
$this->assertTrue($this->wsdl->getComplexTypeStrategy() instanceof Wsdl\ComplexTypeStrategy\DefaultComplexType);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\DefaultComplexType', $this->wsdl->getComplexTypeStrategy());
}

public function testGetComplexTypeBasedOnStrategiesStringNames()
{
$this->wsdl = new Wsdl($this->defaultServiceName, 'http://localhost/MyService.php', new Wsdl\ComplexTypeStrategy\DefaultComplexType);
$this->assertEquals('tns:WsdlTestClass', $this->wsdl->getType('\ZendTest\Soap\TestAsset\WsdlTestClass'));
$this->assertTrue($this->wsdl->getComplexTypeStrategy() instanceof Wsdl\ComplexTypeStrategy\DefaultComplexType);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\DefaultComplexType', $this->wsdl->getComplexTypeStrategy());

$wsdl2 = new Wsdl($this->defaultServiceName, $this->defaultServiceUri, new Wsdl\ComplexTypeStrategy\AnyType);
$this->assertEquals('xsd:anyType', $wsdl2->getType('\ZendTest\Soap\TestAsset\WsdlTestClass'));
$this->assertTrue($wsdl2->getComplexTypeStrategy() instanceof Wsdl\ComplexTypeStrategy\AnyType);
$this->assertInstanceOf('Zend\Soap\Wsdl\ComplexTypeStrategy\AnyType', $wsdl2->getComplexTypeStrategy());
}

public function testAddingSameComplexTypeMoreThanOnceIsIgnored()
Expand Down

0 comments on commit 8c0b6a1

Please sign in to comment.