Renamed SoapClient to SimpleSoapClient

This commit is contained in:
Andreas Schamberger 2011-09-26 15:52:03 +02:00
parent d29f0caa8d
commit a46a42412e
3 changed files with 17 additions and 13 deletions

4
.gitignore vendored
View File

@ -1 +1,5 @@
vendor vendor
/phpunit.xml
.buildpath
.project
.settings

View File

@ -18,7 +18,7 @@ use BeSimple\SoapCommon\Converter\TypeConverterCollection;
/** /**
* @author Francis Besset <francis.besset@gmail.com> * @author Francis Besset <francis.besset@gmail.com>
*/ */
class SoapClient class SimpleSoapClient
{ {
protected $wsdl; protected $wsdl;
protected $converters; protected $converters;

View File

@ -16,13 +16,13 @@ use BeSimple\SoapCommon\Cache;
use BeSimple\SoapCommon\Converter\DateTimeTypeConverter; use BeSimple\SoapCommon\Converter\DateTimeTypeConverter;
use BeSimple\SoapCommon\Converter\DateTypeConverter; use BeSimple\SoapCommon\Converter\DateTypeConverter;
use BeSimple\SoapCommon\Converter\TypeConverterCollection; use BeSimple\SoapCommon\Converter\TypeConverterCollection;
use BeSimple\SoapClient\SoapClient; use BeSimple\SoapClient\SimpleSoapClient;
class SoapClientTest extends \PHPUnit_Framework_TestCase class SoapClientTest extends \PHPUnit_Framework_TestCase
{ {
public function testSetOptions() public function testSetOptions()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$options = array( $options = array(
'cache_type' => Cache::TYPE_DISK_MEMORY, 'cache_type' => Cache::TYPE_DISK_MEMORY,
'debug' => true, 'debug' => true,
@ -35,7 +35,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testSetOptionsThrowsAnExceptionIfOptionsDoesNotExists() public function testSetOptionsThrowsAnExceptionIfOptionsDoesNotExists()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$this->setExpectedException('InvalidArgumentException'); $this->setExpectedException('InvalidArgumentException');
$soapClient->setOptions(array('bad_option' => true)); $soapClient->setOptions(array('bad_option' => true));
@ -43,7 +43,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testSetOption() public function testSetOption()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$soapClient->setOption('debug', true); $soapClient->setOption('debug', true);
$this->assertEquals(true, $soapClient->getOption('debug')); $this->assertEquals(true, $soapClient->getOption('debug'));
@ -51,7 +51,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testSetOptionThrowsAnExceptionIfOptionDoesNotExists() public function testSetOptionThrowsAnExceptionIfOptionDoesNotExists()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$this->setExpectedException('InvalidArgumentException'); $this->setExpectedException('InvalidArgumentException');
$soapClient->setOption('bad_option', 'bar'); $soapClient->setOption('bad_option', 'bar');
@ -59,7 +59,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testGetOptionThrowsAnExceptionIfOptionDoesNotExists() public function testGetOptionThrowsAnExceptionIfOptionDoesNotExists()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$this->setExpectedException('InvalidArgumentException'); $this->setExpectedException('InvalidArgumentException');
$soapClient->getOption('bad_option'); $soapClient->getOption('bad_option');
@ -67,7 +67,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testCreateSoapHeader() public function testCreateSoapHeader()
{ {
$soapClient = new SoapClient('foo.wsdl', null, array('namespace' => 'http://foobar/soap/User/1.0/')); $soapClient = new SimpleSoapClient('foo.wsdl', null, array('namespace' => 'http://foobar/soap/User/1.0/'));
$soapHeader = $soapClient->createSoapHeader('foo', 'bar'); $soapHeader = $soapClient->createSoapHeader('foo', 'bar');
$this->assertInstanceOf('SoapHeader', $soapHeader); $this->assertInstanceOf('SoapHeader', $soapHeader);
@ -78,7 +78,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testCreateSoapHeaderThrowsAnExceptionIfNamespaceIsNull() public function testCreateSoapHeaderThrowsAnExceptionIfNamespaceIsNull()
{ {
$soapClient = new SoapClient('foo.wsdl'); $soapClient = new SimpleSoapClient('foo.wsdl');
$this->setExpectedException('RuntimeException'); $this->setExpectedException('RuntimeException');
$soapHeader = $soapClient->createSoapHeader('foo', 'bar'); $soapHeader = $soapClient->createSoapHeader('foo', 'bar');
@ -87,10 +87,10 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testGetSoapOptions() public function testGetSoapOptions()
{ {
Cache::setType(Cache::TYPE_MEMORY); Cache::setType(Cache::TYPE_MEMORY);
$soapClient = new SoapClient('foo.wsdl', null, array('debug' => true)); $soapClient = new SimpleSoapClient('foo.wsdl', null, array('debug' => true));
$this->assertEquals(array('cache_wsdl' => Cache::getType(), 'trace' => true, 'typemap' => array()), $soapClient->getSoapOptions()); $this->assertEquals(array('cache_wsdl' => Cache::getType(), 'trace' => true, 'typemap' => array()), $soapClient->getSoapOptions());
$soapClient = new SoapClient('foo.wsdl', null, array('debug' => false, 'cache_type' => Cache::TYPE_NONE)); $soapClient = new SimpleSoapClient('foo.wsdl', null, array('debug' => false, 'cache_type' => Cache::TYPE_NONE));
$this->assertEquals(array('cache_wsdl' => Cache::TYPE_NONE, 'trace' => false, 'typemap' => array()), $soapClient->getSoapOptions()); $this->assertEquals(array('cache_wsdl' => Cache::TYPE_NONE, 'trace' => false, 'typemap' => array()), $soapClient->getSoapOptions());
} }
@ -104,7 +104,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
$dateTypeConverter = new DateTypeConverter(); $dateTypeConverter = new DateTypeConverter();
$converters->add($dateTypeConverter); $converters->add($dateTypeConverter);
$soapClient = new SoapClient('foo.wsdl', $converters); $soapClient = new SimpleSoapClient('foo.wsdl', $converters);
$soapOptions = $soapClient->getSoapOptions(); $soapOptions = $soapClient->getSoapOptions();
$this->assertEquals('http://www.w3.org/2001/XMLSchema', $soapOptions['typemap'][0]['type_ns']); $this->assertEquals('http://www.w3.org/2001/XMLSchema', $soapOptions['typemap'][0]['type_ns']);
@ -120,7 +120,7 @@ class SoapClientTest extends \PHPUnit_Framework_TestCase
public function testGetNativeSoapClient() public function testGetNativeSoapClient()
{ {
$soapClient = new SoapClient(__DIR__.'/Fixtures/foobar.wsdl', null, array('debug' => true)); $soapClient = new SimpleSoapClient(__DIR__.'/Fixtures/foobar.wsdl', null, array('debug' => true));
$this->assertInstanceOf('SoapClient', $soapClient->getNativeSoapClient()); $this->assertInstanceOf('SoapClient', $soapClient->getNativeSoapClient());
} }