1 | <?php |
||
11 | class SwaggerRequester |
||
12 | { |
||
13 | protected $method = 'get'; |
||
14 | protected $path = '/'; |
||
15 | protected $requestHeader = []; |
||
16 | protected $query = []; |
||
17 | protected $requestBody = null; |
||
18 | /** |
||
19 | * @var \ByJG\Swagger\SwaggerSchema |
||
20 | */ |
||
21 | protected $swaggerSchema = null; |
||
22 | |||
23 | protected $statusExpected = 200; |
||
24 | protected $assertHeader = []; |
||
25 | |||
26 | /** |
||
27 | * @var \GuzzleHttp\ClientInterface |
||
28 | */ |
||
29 | protected $guzzleHttpClient; |
||
30 | |||
31 | public function __construct() |
||
35 | |||
36 | public function withSwaggerSchema($schema) |
||
42 | |||
43 | /** |
||
44 | * @param string $method |
||
45 | * @return SwaggerRequester |
||
46 | */ |
||
47 | public function withMethod($method) |
||
53 | |||
54 | /** |
||
55 | * @param string $path |
||
56 | * @return SwaggerRequester |
||
57 | */ |
||
58 | public function withPath($path) |
||
64 | |||
65 | /** |
||
66 | * @param array $requestHeader |
||
67 | * @return SwaggerRequester |
||
68 | */ |
||
69 | public function withRequestHeader($requestHeader) |
||
80 | |||
81 | /** |
||
82 | * @param array $query |
||
83 | * @return SwaggerRequester |
||
84 | */ |
||
85 | public function withQuery($query) |
||
96 | |||
97 | /** |
||
98 | * @param null $requestBody |
||
99 | * @return SwaggerRequester |
||
100 | */ |
||
101 | public function withRequestBody($requestBody) |
||
107 | |||
108 | public function assertResponseCode($code) |
||
114 | |||
115 | public function assertHeaderContains($header, $contains) |
||
121 | |||
122 | /** |
||
123 | * @return mixed |
||
124 | * @throws \ByJG\Swagger\Exception\HttpMethodNotFoundException |
||
125 | * @throws \ByJG\Swagger\Exception\InvalidDefinitionException |
||
126 | * @throws \ByJG\Swagger\Exception\NotMatchedException |
||
127 | * @throws \ByJG\Swagger\Exception\PathNotFoundException |
||
128 | * @throws \ByJG\Swagger\Exception\RequiredArgumentNotFound |
||
129 | * @throws \Exception |
||
130 | */ |
||
131 | public function send() |
||
209 | } |
||
210 |