|
25 | 25 | /** |
26 | 26 | * Module for testing REST WebService. |
27 | 27 | * |
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. |
31 | 31 | * |
32 | 32 | * ## Configuration |
33 | 33 | * |
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 |
36 | 36 | * |
37 | | - * This module requires PHPBrowser or any of Framework modules enabled. |
| 37 | + * ### Example |
38 | 38 | * |
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 | + * ``` |
41 | 47 | * |
42 | | - * ### Example |
| 48 | + * In case you need to configure low-level HTTP headers, that's done on the PhpBrowser level like so: |
43 | 49 | * |
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 | + * ``` |
55 | 62 | * |
56 | 63 | * ## Public Properties |
57 | 64 | * |
|
0 commit comments