Skip to content

Commit f9cb4bd

Browse files
committed
Merge branch 'release/1.0.8', fixes #7
2 parents 0e3cae9 + 0530698 commit f9cb4bd

File tree

10 files changed

+97
-64
lines changed

10 files changed

+97
-64
lines changed

.php_cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<?php
22

3-
$finder = Symfony\CS\Finder\DefaultFinder::create()
3+
$finder = PhpCsFixer\Finder::create()
44
->exclude('vendor')
5-
->exclude('Tests/resources')
5+
->exclude('tests')
66
->in(__DIR__);
77

8-
return Symfony\CS\Config\Config::create()
9-
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
10-
->finder($finder);
8+
return PhpCsFixer\Config::create()
9+
->setUsingCache(false)
10+
->setRules(array(
11+
'@PSR2' => true,
12+
'binary_operator_spaces' => true,
13+
'no_whitespace_in_blank_line' => true,
14+
'ternary_operator_spaces' => true,
15+
'cast_spaces' => true,
16+
'trailing_comma_in_multiline_array' => true
17+
))
18+
->setFinder($finder);

.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

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 1.0.8
4+
- Issue #7 - Missing SoapClient location option
5+
36
## 1.0.7
47
- Issue #3 - More than one SoapClient in Project
58

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"php" : ">=5.3.3"
2525
},
2626
"require-dev": {
27-
"fabpot/php-cs-fixer": "~1.8"
27+
"friendsofphp/php-cs-fixer": "~2.0",
28+
"phpunit/phpunit": "~4.0"
2829
},
2930
"autoload": {
3031
"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/AbstractStructBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static function __set_state(array $array)
1515
{
1616
$className = get_called_class();
1717
$object = @new $className();
18-
foreach ($array as $name=>$value) {
18+
foreach ($array as $name => $value) {
1919
$object->_set($name, $value);
2020
}
2121
return $object;

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: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function testSoapClientName()
1414
{
1515
$soapClient = new SoapClient();
1616

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

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

38-
$this->assertInstanceOf('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClient());
38+
$this->assertInstanceOf('\WsdlToPhp\PackageBase\Tests\Client', $soapClient->getSoapClient());
3939
}
4040
/**
4141
*
@@ -51,6 +51,19 @@ public function testSetLocation()
5151

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

76-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastRequest(true));
89+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastRequest(true));
7790
}
7891
/**
7992
*
@@ -97,7 +110,7 @@ public function testGetLastResponseAsDomDocument()
97110
SoapClient::WSDL_CLASSMAP => self::classMap(),
98111
));
99112

100-
$this->assertInstanceOf('\\DOMDocument', $soapClient->getLastResponse(true));
113+
$this->assertInstanceOf('\DOMDocument', $soapClient->getLastResponse(true));
101114
}
102115
/**
103116
*
@@ -160,7 +173,7 @@ public function testSetGetLastErrorForMethod()
160173
// this call should fail as no parameter is defined in the request
161174
$soapClient->search();
162175

163-
$this->assertInstanceOf('\\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
176+
$this->assertInstanceOf('\SoapFault', $soapClient->getLastErrorForMethod('WsdlToPhp\PackageBase\Tests\SoapClient::search'));
164177
}
165178
/**
166179
*

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)