Skip to content

Commit d1bfc5a

Browse files
Docs: Some rephrasings (#42)
* Some rephrasings Inspired by Codeception/Codeception#6026 (comment) Main goal: Deleting the *multiple* PhpBrowser/Framework dependency. Question: What is `&url` in this line? Typo?: ``` url: &url 'http://serviceapp/api/v1/' # you only need the &url anchor for further PhpBrowser configs ``` * Separating the `&url` case into its own code block
1 parent 69f9b53 commit d1bfc5a

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

src/Codeception/Module/REST.php

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,40 @@
2525
/**
2626
* Module for testing REST WebService.
2727
*
28-
* This module can be used either with frameworks or PHPBrowser.
29-
* If a framework module is connected, the testing will occur in the application directly.
30-
* Otherwise, a PHPBrowser should be specified as a dependency to send requests and receive responses from a server.
28+
* This module requires either [PhpBrowser](https://codeception.com/docs/modules/PhpBrowser)
29+
* or a framework module (e.g. [Symfony](https://codeception.com/docs/modules/Symfony), [Laravel](https://codeception.com/docs/modules/Laravel5))
30+
* to send the actual HTTP request.
3131
*
3232
* ## Configuration
3333
*
34-
* * url *optional* - the url of api
35-
* * shortDebugResponse *optional* - amount of chars to limit the api response length
34+
* * `url` *optional* - the url of api
35+
* * `shortDebugResponse` *optional* - number of chars to limit the API response length
3636
*
37-
* This module requires PHPBrowser or any of Framework modules enabled.
37+
* ### Example
3838
*
39-
* In case you need to configure low-level HTTP fields, that's done on the PHPBrowser level.
40-
* Check the example below for details.
39+
* ```yaml
40+
* modules:
41+
* enabled:
42+
* - REST:
43+
* depends: PhpBrowser
44+
* url: 'https://example.com/api/v1/'
45+
* shortDebugResponse: 300 # only the first 300 characters of the response
46+
* ```
4147
*
42-
* ### Example
48+
* In case you need to configure low-level HTTP headers, that's done on the PhpBrowser level like so:
4349
*
44-
* modules:
45-
* enabled:
46-
* - REST:
47-
* depends: PhpBrowser
48-
* url: &url 'http://serviceapp/api/v1/' # you only need the &url anchor for further PhpBrowser configs
49-
* shortDebugResponse: 300 # only the first 300 chars of the response
50-
* config:
51-
* PhpBrowser:
52-
* url: *url # repeats the URL from the REST module; not needed if you don't have further settings like below
53-
* headers:
54-
* Content-Type: application/json
50+
* ```yaml
51+
* modules:
52+
* enabled:
53+
* - REST:
54+
* depends: PhpBrowser
55+
* url: &url 'https://example.com/api/v1/'
56+
* config:
57+
* PhpBrowser:
58+
* url: *url
59+
* headers:
60+
* Content-Type: application/json
61+
* ```
5562
*
5663
* ## Public Properties
5764
*

0 commit comments

Comments
 (0)