diff --git a/src/BeSimple/SoapClient/SoapClientBuilder.php b/src/BeSimple/SoapClient/SoapClientBuilder.php index 7134cf6..5ec9678 100644 --- a/src/BeSimple/SoapClient/SoapClientBuilder.php +++ b/src/BeSimple/SoapClient/SoapClientBuilder.php @@ -19,9 +19,6 @@ use BeSimple\SoapCommon\AbstractSoapBuilder; */ class SoapClientBuilder extends AbstractSoapBuilder { - protected $wsdl; - protected $options; - /** * @return SoapClientBuilder */ @@ -34,21 +31,21 @@ class SoapClientBuilder extends AbstractSoapBuilder public function withTrace($trace = true) { - $this->options['trace'] = $trace; + $this->soapOptions['trace'] = $trace; return $this; } public function withExceptions($exceptions = true) { - $this->options['exceptions'] = $exceptions; + $this->soapOptions['exceptions'] = $exceptions; return $this; } public function withUserAgent($userAgent) { - $this->options['user_agent'] = $userAgent; + $this->soapOptions['user_agent'] = $userAgent; return $this; } diff --git a/tests/BeSimple/Tests/SoapClient/SoapClientBuilderTest.php b/tests/BeSimple/Tests/SoapClient/SoapClientBuilderTest.php index cad1111..7ba11c2 100644 --- a/tests/BeSimple/Tests/SoapClient/SoapClientBuilderTest.php +++ b/tests/BeSimple/Tests/SoapClient/SoapClientBuilderTest.php @@ -18,13 +18,15 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase { private $defaultOptions = array( 'features' => 0, + 'classmap' => array(), + 'typemap' => array(), ); public function testContruct() { $options = $this ->getSoapBuilder() - ->getOptions() + ->getSoapOptions() ; $this->assertEquals($this->mergeOptions(array()), $options); @@ -35,10 +37,10 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase $builder = $this->getSoapBuilder(); $builder->withTrace(); - $this->assertEquals($this->mergeOptions(array('trace' => true)), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('trace' => true)), $builder->getSoapOptions()); $builder->withTrace(false); - $this->assertEquals($this->mergeOptions(array('trace' => false)), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('trace' => false)), $builder->getSoapOptions()); } public function testWithExceptions() @@ -46,10 +48,10 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase $builder = $this->getSoapBuilder(); $builder->withExceptions(); - $this->assertEquals($this->mergeOptions(array('exceptions' => true)), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('exceptions' => true)), $builder->getSoapOptions()); $builder->withExceptions(false); - $this->assertEquals($this->mergeOptions(array('exceptions' => false)), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('exceptions' => false)), $builder->getSoapOptions()); } public function testWithUserAgent() @@ -57,7 +59,7 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase $builder = $this->getSoapBuilder(); $builder->withUserAgent('BeSimpleSoap Test'); - $this->assertEquals($this->mergeOptions(array('user_agent' => 'BeSimpleSoap Test')), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('user_agent' => 'BeSimpleSoap Test')), $builder->getSoapOptions()); } public function testCreateWithDefaults() @@ -66,7 +68,7 @@ class SoapClientBuilderTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('BeSimple\SoapClient\SoapClientBuilder', $builder); - $this->assertEquals($this->mergeOptions(array('soap_version' => SOAP_1_2, 'encoding' => 'UTF-8', 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'user_agent' => 'BeSimpleSoap')), $builder->getOptions()); + $this->assertEquals($this->mergeOptions(array('soap_version' => SOAP_1_2, 'encoding' => 'UTF-8', 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'user_agent' => 'BeSimpleSoap')), $builder->getSoapOptions()); } private function getSoapBuilder()