1 | <?php |
||
17 | abstract class BaseTestCase extends TestCase |
||
18 | { |
||
19 | /** |
||
20 | * @var Schema |
||
21 | */ |
||
22 | protected $swaggerSchema; |
||
23 | |||
24 | protected $filePath; |
||
25 | |||
26 | /** |
||
27 | * @param string $method The HTTP Method: GET, PUT, DELETE, POST, etc |
||
28 | * @param string $path The REST path call |
||
29 | * @param int $statusExpected |
||
30 | * @param array|null $query |
||
31 | * @param array|null $requestBody |
||
32 | * @param array $requestHeader |
||
33 | * @return mixed |
||
34 | * @throws DefinitionNotFoundException |
||
35 | * @throws HttpMethodNotFoundException |
||
36 | * @throws InvalidDefinitionException |
||
37 | * @throws NotMatchedException |
||
38 | * @throws PathNotFoundException |
||
39 | * @throws StatusCodeNotMatchedException |
||
40 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
41 | * @deprecated Use assertRequest instead |
||
42 | */ |
||
43 | protected function makeRequest( |
||
70 | |||
71 | /** |
||
72 | * @param ApiRequester $request |
||
73 | * @return mixed |
||
74 | * @throws DefinitionNotFoundException |
||
75 | * @throws HttpMethodNotFoundException |
||
76 | * @throws InvalidDefinitionException |
||
77 | * @throws NotMatchedException |
||
78 | * @throws PathNotFoundException |
||
79 | * @throws StatusCodeNotMatchedException |
||
80 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
81 | */ |
||
82 | public function assertRequest(ApiRequester $request) |
||
100 | } |
||
101 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.