Skip to content

Commit f41f1bc

Browse files
authored
doc(v1): corrected typos and missing parts in the readme (#4)
1 parent 74120b1 commit f41f1bc

File tree

2 files changed

+60
-50
lines changed

2 files changed

+60
-50
lines changed

README.md renamed to README.mdx

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,28 @@ The `call` method returns an instance of `CodeDredd\Soap\Client\Response`, which
5959
The `CodeDredd\Soap\Client\Response` object also implements the PHP `ArrayAccess` interface, allowing you to access your response data directly on the response:
6060

6161
return Soap::baseWsdl('http://test.com'/v1?wsdl)->call('Get_Users')['name'];
62+
63+
If you have published the config file then your able to setup a soap client in that configuration. After that it's even easier to initialize the client:
64+
65+
$client = Soap::buildClient('your_client_name');
66+
$response = $client->call(...);
6267

6368
<a name="request-data"></a>
6469
### Request Data
6570

6671
Of course, calling a action with arguments is also possible:
6772

68-
$response = Soap::baseWsdl('http://test.com'/v1?wsdl)->call('Submit_User', [
69-
'name' => 'Steve',
70-
'role' => 'Network Administrator',
71-
]);
73+
$response = Soap::baseWsdl('http://test.com'/v1?wsdl)
74+
->call('Submit_User', [
75+
'name' => 'Steve',
76+
'role' => 'Network Administrator',
77+
]);
7278
// Or via magic method call
73-
$response = Soap::baseWsdl('http://test.com'/v1?wsdl)->Submit_User([
74-
'name' => 'Steve',
75-
'role' => 'Network Administrator',
76-
]);
79+
$response = Soap::baseWsdl('http://test.com'/v1?wsdl)
80+
->Submit_User([
81+
'name' => 'Steve',
82+
'role' => 'Network Administrator',
83+
]);
7784

7885
<a name="headers"></a>
7986
### Headers
@@ -159,7 +166,10 @@ The `CodeDredd\Soap\Exceptions\RequestException` instance has a public `$respons
159166

160167
The `throw` method returns the response instance if no error occurred, allowing you to chain other operations onto the `throw` method:
161168

162-
return Soap::baseWsdl(...)->call(...)->throw()->json();
169+
return Soap::baseWsdl(...)
170+
->call(...)
171+
->throw()
172+
->json();
163173

164174
<a name="soap-options"></a>
165175
### Soap Client Options
@@ -204,7 +214,7 @@ For example, to instruct the SOAP client to return empty, `200` status code resp
204214

205215
Alternatively, you may pass an array to the `fake` method. The array's keys should represent ACTION patterns that you wish to fake and their associated responses. The `*` character may be used as a wildcard character. You may use the `response` method to construct stub / fake responses for these endpoints:
206216
The difference between Laravels HTTP wrapper is the fact that actions which are not defined in fake are also faked with a default 200 response!
207-
Also a faked response status code is always 200 if you define it int the range between 200 and 400. Status codes 400 and greater are correct faked.
217+
Also a faked response status code is always 200 if you define it in the range between 200 and 400. Status codes 400 and greater are correct responded.
208218

209219
Soap::fake([
210220
// Stub a JSON response for all Get_ actions...
@@ -238,26 +248,26 @@ Sometimes you may need to specify that a single ACTION should return a series of
238248
Soap::fake([
239249
// Stub a series of responses for Get_* actions...
240250
'Get_*' => Soap::sequence()
241-
->push('Hello World')
242-
->push(['foo' => 'bar'])
243-
->pushStatus(404),
251+
->push('Hello World')
252+
->push(['foo' => 'bar'])
253+
->pushStatus(404)
244254
]);
245255

246256
When all of the responses in a response sequence have been consumed, any further requests will cause the response sequence to throw an exception. If you would like to specify a default response that should be returned when a sequence is empty, you may use the `whenEmpty` method:
247257

248258
Soap::fake([
249-
/ Stub a series of responses for Get_* actions...
259+
// Stub a series of responses for Get_* actions...
250260
'Get_*' => Soap::sequence()
251-
->push('Hello World')
252-
->push(['foo' => 'bar'])
253-
->whenEmpty(Soap::response()),
261+
->push('Hello World')
262+
->push(['foo' => 'bar'])
263+
->whenEmpty(Soap::response())
254264
]);
255265

256266
If you would like to fake a sequence of responses but do not need to specify a specific ACTION pattern that should be faked, you may use the `Soap::fakeSequence` method:
257267

258268
Soap::fakeSequence()
259-
->push('Hello World')
260-
->whenEmpty(Soap::response());
269+
->push('Hello World')
270+
->whenEmpty(Soap::response());
261271

262272
#### Fake Callback
263273

phpunit.xml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="Laravel Soap Test Suite">
14-
<directory>tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<php>
23-
<server name="APP_ENV" value="testing"/>
24-
<server name="API_PREFIX" value="api"/>
25-
<server name="BCRYPT_ROUNDS" value="4"/>
26-
<server name="CACHE_DRIVER" value="array"/>
27-
<server name="MAIL_DRIVER" value="array"/>
28-
<server name="QUEUE_CONNECTION" value="sync"/>
29-
<server name="SESSION_DRIVER" value="array"/>
30-
</php>
31-
</phpunit>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Laravel Soap Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<php>
23+
<server name="APP_ENV" value="testing"/>
24+
<server name="API_PREFIX" value="api"/>
25+
<server name="BCRYPT_ROUNDS" value="4"/>
26+
<server name="CACHE_DRIVER" value="array"/>
27+
<server name="MAIL_DRIVER" value="array"/>
28+
<server name="QUEUE_CONNECTION" value="sync"/>
29+
<server name="SESSION_DRIVER" value="array"/>
30+
</php>
31+
</phpunit>

0 commit comments

Comments
 (0)