Skip to content

Commit ad246a0

Browse files
committed
Merge branch 'feature/issue-8' into develop
2 parents ebfda44 + 1979f92 commit ad246a0

File tree

7 files changed

+85
-59
lines changed

7 files changed

+85
-59
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ php:
77
- 5.4
88
- 5.5
99
- 5.6
10-
- 7
10+
- 7.0
11+
- 7.1
1112

1213
before_install:
1314
- composer self-update
1415

1516
install:
16-
- composer install --no-dev
17+
- composer install
1718

1819
script:
19-
- phpunit --coverage-text --coverage-clover=coverage.clover
20+
- ./vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover
2021

2122
after_script:
2223
- wget https://scrutinizer-ci.com/ocular.phar
23-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
24+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"php" : ">=5.3.3"
2020
},
2121
"require-dev": {
22-
"fabpot/php-cs-fixer": "~1.8"
22+
"fabpot/php-cs-fixer": "~1.8",
23+
"phpunit/phpunit": "~4.0"
2324
},
2425
"autoload": {
2526
"psr-4": {

src/AbstractSoapClientBase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function getSoapClientClassName($soapClientClassName = null)
107107
* @uses AbstractSoapClientBase::WSDL_ENCODING
108108
* @uses AbstractSoapClientBase::WSDL_EXCEPTIONS
109109
* @uses AbstractSoapClientBase::WSDL_FEATURES
110+
* @uses AbstractSoapClientBase::WSDL_LOCATION
110111
* @uses AbstractSoapClientBase::WSDL_LOGIN
111112
* @uses AbstractSoapClientBase::WSDL_PASSWORD
112113
* @uses AbstractSoapClientBase::WSDL_SOAP_VERSION
@@ -138,6 +139,7 @@ public static function getDefaultWsdlOptions()
138139
self::WSDL_ENCODING => null,
139140
self::WSDL_EXCEPTIONS => true,
140141
self::WSDL_FEATURES => SOAP_SINGLE_ELEMENT_ARRAYS | SOAP_USE_XSI_ARRAY_TYPE,
142+
self::WSDL_LOCATION => null,
141143
self::WSDL_LOGIN => null,
142144
self::WSDL_PASSWORD => null,
143145
self::WSDL_SOAP_VERSION => null,

src/SoapClientInterface.php

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,125 +13,130 @@ interface SoapClientInterface
1313
*/
1414
const OPTION_PREFIX = 'wsdl_';
1515
/**
16-
* Option key to define WSDL url
16+
* Option key to define WSDL authentication
1717
* @var string
1818
*/
19-
const WSDL_URL = 'wsdl_url';
19+
const WSDL_AUTHENTICATION = 'wsdl_authentication';
20+
/**
21+
* Option key to define WSDL cache_wsdl
22+
* @var string
23+
*/
24+
const WSDL_CACHE_WSDL = 'wsdl_cache_wsdl';
2025
/**
2126
* Option key to define WSDL classmap
2227
* @var string
2328
*/
2429
const WSDL_CLASSMAP = 'wsdl_classmap';
2530
/**
26-
* Option key to define WSDL login
31+
* Option key to define WSDL compression
2732
* @var string
2833
*/
29-
const WSDL_LOGIN = 'wsdl_login';
34+
const WSDL_COMPRESSION = 'wsdl_compression';
3035
/**
31-
* Option key to define WSDL password
36+
* Option key to define WSDL connection_timeout
3237
* @var string
3338
*/
34-
const WSDL_PASSWORD = 'wsdl_password';
39+
const WSDL_CONNECTION_TIMEOUT = 'wsdl_connection_timeout';
3540
/**
36-
* Option key to define WSDL trace option
41+
* Option key to define WSDL encoding
3742
* @var string
3843
*/
39-
const WSDL_TRACE = 'wsdl_trace';
44+
const WSDL_ENCODING = 'wsdl_encoding';
4045
/**
4146
* Option key to define WSDL exceptions
4247
* @var string
4348
*/
4449
const WSDL_EXCEPTIONS = 'wsdl_exceptions';
4550
/**
46-
* Option key to define WSDL cache_wsdl
51+
* Option key to define WSDL features
4752
* @var string
4853
*/
49-
const WSDL_CACHE_WSDL = 'wsdl_cache_wsdl';
54+
const WSDL_FEATURES = 'wsdl_features';
5055
/**
51-
* Option key to define WSDL stream_context
56+
* Option key to define WSDL keep_alive
5257
* @var string
5358
*/
54-
const WSDL_STREAM_CONTEXT = 'wsdl_stream_context';
59+
const WSDL_KEEP_ALIVE = 'wsdl_keep_alive';
5560
/**
56-
* Option key to define WSDL soap_version
61+
* Option key to define WSDL local_cert
5762
* @var string
5863
*/
59-
const WSDL_SOAP_VERSION = 'wsdl_soap_version';
64+
const WSDL_LOCAL_CERT = 'wsdl_local_cert';
6065
/**
61-
* Option key to define WSDL compression
66+
* Option key to define WSDL location
6267
* @var string
6368
*/
64-
const WSDL_COMPRESSION = 'wsdl_compression';
69+
const WSDL_LOCATION = 'wsdl_location';
6570
/**
66-
* Option key to define WSDL encoding
71+
* Option key to define WSDL login
6772
* @var string
6873
*/
69-
const WSDL_ENCODING = 'wsdl_encoding';
74+
const WSDL_LOGIN = 'wsdl_login';
7075
/**
71-
* Option key to define WSDL connection_timeout
76+
* Option key to define WSDL passphrase
7277
* @var string
7378
*/
74-
const WSDL_CONNECTION_TIMEOUT = 'wsdl_connection_timeout';
79+
const WSDL_PASSPHRASE = 'wsdl_passphrase';
7580
/**
76-
* Option key to define WSDL typemap
81+
* Option key to define WSDL password
7782
* @var string
7883
*/
79-
const WSDL_TYPEMAP = 'wsdl_typemap';
84+
const WSDL_PASSWORD = 'wsdl_password';
8085
/**
81-
* Option key to define WSDL user_agent
86+
* Option key to define WSDL proxy_host
8287
* @var string
8388
*/
84-
const WSDL_USER_AGENT = 'wsdl_user_agent';
89+
const WSDL_PROXY_HOST = 'wsdl_proxy_host';
8590
/**
86-
* Option key to define WSDL features
91+
* Option key to define WSDL proxy_login
8792
* @var string
8893
*/
89-
const WSDL_FEATURES = 'wsdl_features';
94+
const WSDL_PROXY_LOGIN = 'wsdl_proxy_login';
9095
/**
91-
* Option key to define WSDL keep_alive
96+
* Option key to define WSDL proxy_password
9297
* @var string
9398
*/
94-
const WSDL_KEEP_ALIVE = 'wsdl_keep_alive';
99+
const WSDL_PROXY_PASSWORD = 'wsdl_proxy_password';
95100
/**
96-
* Option key to define WSDL proxy_host
101+
* Option key to define WSDL proxy_port
97102
* @var string
98103
*/
99-
const WSDL_PROXY_HOST = 'wsdl_proxy_host';
104+
const WSDL_PROXY_PORT = 'wsdl_proxy_port';
100105
/**
101-
* Option key to define WSDL proxy_port
106+
* Option key to define WSDL soap_version
102107
* @var string
103108
*/
104-
const WSDL_PROXY_PORT = 'wsdl_proxy_port';
109+
const WSDL_SOAP_VERSION = 'wsdl_soap_version';
105110
/**
106-
* Option key to define WSDL proxy_login
111+
* Option key to define WSDL ssl_method
107112
* @var string
108113
*/
109-
const WSDL_PROXY_LOGIN = 'wsdl_proxy_login';
114+
const WSDL_SSL_METHOD = 'wsdl_ssl_method';
110115
/**
111-
* Option key to define WSDL proxy_password
116+
* Option key to define WSDL stream_context
112117
* @var string
113118
*/
114-
const WSDL_PROXY_PASSWORD = 'wsdl_proxy_password';
119+
const WSDL_STREAM_CONTEXT = 'wsdl_stream_context';
115120
/**
116-
* Option key to define WSDL local_cert
121+
* Option key to define WSDL trace option
117122
* @var string
118123
*/
119-
const WSDL_LOCAL_CERT = 'wsdl_local_cert';
124+
const WSDL_TRACE = 'wsdl_trace';
120125
/**
121-
* Option key to define WSDL passphrase
126+
* Option key to define WSDL typemap
122127
* @var string
123128
*/
124-
const WSDL_PASSPHRASE = 'wsdl_passphrase';
129+
const WSDL_TYPEMAP = 'wsdl_typemap';
125130
/**
126-
* Option key to define WSDL authentication
131+
* Option key to define WSDL url
127132
* @var string
128133
*/
129-
const WSDL_AUTHENTICATION = 'wsdl_authentication';
134+
const WSDL_URL = 'wsdl_url';
130135
/**
131-
* Option key to define WSDL ssl_method
136+
* Option key to define WSDL user_agent
132137
* @var string
133138
*/
134-
const WSDL_SSL_METHOD = 'wsdl_ssl_method';
139+
const WSDL_USER_AGENT = 'wsdl_user_agent';
135140
/**
136141
* Constructor
137142
* @uses SoapClientInterface::setLastError()

tests/SoapClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SoapClient extends AbstractSoapClientBase
88
{
99
public function getSoapClientClassName($soapClientClassName = null)
1010
{
11-
return parent::getSoapClientClassName(empty($soapClientClassName) ? '\\WsdlToPhp\\PackageBase\\Tests\\Client' : $soapClientClassName);
11+
return parent::getSoapClientClassName(empty($soapClientClassName) ? '\WsdlToPhp\PackageBase\Tests\Client' : $soapClientClassName);
1212
}
1313
/**
1414
* @return Client

tests/SoapClientTest.php

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function testSoapClientName()
1515
{
1616
$soapClient = new SoapClient();
1717

18-
$this->assertSame('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClientClassName());
18+
$this->assertSame('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClientClassName());
1919
}
2020
/**
2121
*
@@ -24,7 +24,7 @@ public function testSoapClientNameDefault()
2424
{
2525
$soapClient = new SoapClient();
2626

27-
$this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\\WsdlToPhp\\PackageBase\\Tests\\Clien'));
27+
$this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\WsdlToPhp\PackageBase\Tests\Clien'));
2828
}
2929
/**
3030
*
@@ -36,7 +36,7 @@ public function testSoapClient()
3636
SoapClient::WSDL_CLASSMAP => self::classMap(),
3737
));
3838

39-
$this->assertInstanceOf('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClient());
39+
$this->assertInstanceOf('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClient());
4040
}
4141
/**
4242
*
@@ -52,6 +52,19 @@ public function testSetLocation()
5252

5353
$this->assertSAme('http://api.bing.net:80/soap.asm', $soapClient->getSoapClient()->location);
5454
}
55+
/**
56+
*
57+
*/
58+
public function testLocationOotion()
59+
{
60+
$soapClient = new SoapClient(array(
61+
SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl',
62+
SoapClient::WSDL_CLASSMAP => self::classMap(),
63+
SoapClient::WSDL_LOCATION => 'http://api.bing.net:80/soap.asm',
64+
));
65+
66+
$this->assertSAme('http://api.bing.net:80/soap.asm', $soapClient->getSoapClient()->location);
67+
}
5568
/**
5669
*
5770
*/
@@ -74,7 +87,7 @@ public function testGetLastRequestAsDomDocument()
7487
SoapClient::WSDL_CLASSMAP => self::classMap(),
7588
));
7689

77-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastRequest(true));
90+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastRequest(true));
7891
}
7992
/**
8093
*
@@ -98,7 +111,7 @@ public function testGetLastResponseAsDomDocument()
98111
SoapClient::WSDL_CLASSMAP => self::classMap(),
99112
));
100113

101-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastResponse(true));
114+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastResponse(true));
102115
}
103116
/**
104117
*
@@ -161,7 +174,7 @@ public function testSetGetLastErrorForMethod()
161174
// this call should fail as no parameter is defined in the request
162175
$soapClient->search();
163176

164-
$this->assertInstanceOf('\\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
177+
$this->assertInstanceOf('\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
165178
}
166179
/**
167180
*
@@ -333,7 +346,11 @@ public function testGetStreamContextAsNill()
333346
SoapClient::WSDL_CLASSMAP => self::classMap(),
334347
));
335348

336-
$this->assertNull($soapClient->getStreamContext());
349+
if (PHP_VERSION_ID < 70013) {
350+
$this->assertNull($soapClient->getStreamContext());
351+
} else {
352+
$this->assertTrue(is_resource($soapClient->getStreamContext()));
353+
}
337354
}
338355
/**
339356
*

tests/UtilsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public function testGetFormatedXmlInvalidXmlAsDomDocument()
4646
*/
4747
public function testGetDOMDocument()
4848
{
49-
$this->assertInstanceOf('\\DOMDocument', Utils::getDOMDocument(file_get_contents(__DIR__ . '/resources/oneline.xml')));
49+
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(file_get_contents(__DIR__ . '/resources/oneline.xml')));
5050
}
5151
/**
5252
* @expectedException \InvalidArgumentException
5353
*/
5454
public function testGetDOMDocumentException()
5555
{
56-
$this->assertInstanceOf('\\DOMDocument', Utils::getDOMDocument(''));
56+
$this->assertInstanceOf('\DOMDocument', Utils::getDOMDocument(''));
5757
}
5858
}

0 commit comments

Comments
 (0)