Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added $options array to TestCase::getMockFromWsdl

Summary:

So that the SOAPClient is created with the appropriate options and additional parameter has been added to getMockFromWsdl and passed through to the MockObject_Generator. This is required if your create a mock method for __doRequest and pass a complex xml string. If you do not have the option to set client options it can result in different interpretation of objects and arrays by the SOAPClient.
  • Loading branch information...
commit 8c3ef881740a426cf66026f13d83c0ffc57b82dd 1 parent c77923f
@alistairstead alistairstead authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 PHPUnit/Framework/TestCase.php
View
7 PHPUnit/Framework/TestCase.php
@@ -1432,10 +1432,11 @@ public function getMockForAbstractClass($originalClassName, array $arguments = a
* @param string $mockClassName
* @param array $methods
* @param boolean $callOriginalConstructor
+ * @param array $options An array of options passed to SOAPClient::_construct
* @return PHPUnit_Framework_MockObject_MockObject
* @since Method available since Release 3.4.0
*/
- protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = TRUE)
+ protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = TRUE, array $options = array())
{
if ($originalClassName === '') {
$originalClassName = str_replace(
@@ -1446,7 +1447,7 @@ protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClas
if (!class_exists($originalClassName)) {
eval(
$this->mockObjectGenerator->generateClassFromWsdl(
- $wsdlFile, $originalClassName, $methods
+ $wsdlFile, $originalClassName, $methods, $options
)
);
}
@@ -1454,7 +1455,7 @@ protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClas
return $this->getMock(
$originalClassName,
$methods,
- array('', array()),
+ array('', $options),
$mockClassName,
$callOriginalConstructor,
FALSE,
Please sign in to comment.
Something went wrong with that request. Please try again.