1 | <?php |
||
10 | class ApiTestCase extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * Base URL for all paths to append to |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $baseUrl = 'https://onfleet.com/api/v2/'; |
||
18 | |||
19 | /** |
||
20 | * @var Client |
||
21 | */ |
||
22 | protected $client; |
||
23 | |||
24 | /** |
||
25 | * @var Mock |
||
26 | */ |
||
27 | protected $mockedResponses; |
||
28 | |||
29 | /** |
||
30 | * @var History |
||
31 | */ |
||
32 | protected $history; |
||
33 | |||
34 | /** |
||
35 | * Setup client with history and mocked responses |
||
36 | */ |
||
37 | public function setUp() |
||
46 | |||
47 | /** |
||
48 | * @param string $path |
||
49 | */ |
||
50 | public function assertRequestIsGet($path) |
||
57 | |||
58 | /** |
||
59 | * Assert request is post, has JSON content type and optionally check payload data |
||
60 | * |
||
61 | * @param string $path |
||
62 | * @param array|null $data |
||
63 | */ |
||
64 | public function assertRequestIsPost($path, array $data = null) |
||
77 | |||
78 | /** |
||
79 | * Assert request is put, has JSON content type and optionally check payload data |
||
80 | * |
||
81 | * @param string $path |
||
82 | * @param array|null $data |
||
83 | */ |
||
84 | public function assertRequestIsPut($path, array $data = null) |
||
97 | } |
||
98 |