1 | <?php |
||
19 | class HttpClient |
||
20 | { |
||
21 | private $chain; |
||
22 | |||
23 | private $methods = [ |
||
24 | 'sendingPostRequest' => 'post', |
||
25 | 'sendingJsonPostRequest' => 'postJson', |
||
26 | 'sendingDeleteRequest' => 'delete', |
||
27 | 'sendingJsonDeleteRequest' => 'deleteJson', |
||
28 | 'sendingPutRequest' => 'put', |
||
29 | 'sendingJsonPutRequest' => 'putJson', |
||
30 | 'sendingPatchRequest' => 'patch', |
||
31 | 'sendingJsonPatchRequest' => 'patchJson', |
||
32 | 'sendingGetRequest' => 'get', |
||
33 | 'sendingJsonGetRequest' => 'getJson', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * HttpClient constructor. |
||
38 | * |
||
39 | * @param $phpunit |
||
40 | */ |
||
41 | 11 | public function __construct($phpunit) |
|
45 | |||
46 | 11 | public function __call($method, $params): IsRespondedWith |
|
50 | |||
51 | 11 | private function sendRequest($method, ...$data): IsRespondedWith |
|
57 | |||
58 | public function exceptionIsThrown($type) |
||
62 | |||
63 | public function whenEventHappens($event): self |
||
69 | } |
||
70 |