@@ 14-23 (lines=10) @@ | ||
11 | ||
12 | class UnitTestCase extends TestCase |
|
13 | { |
|
14 | protected function mockAPIStatus(&$container = [], $key = 'key') |
|
15 | { |
|
16 | $history = Middleware::history($container); |
|
17 | ||
18 | $mockHandler = new MockHandler([ |
|
19 | new Response(200, [], json_encode(['success' => true, 'data' => 'mocked-data'])), |
|
20 | ]); |
|
21 | ||
22 | return new Client($key, [$history], $mockHandler); |
|
23 | } |
|
24 | ||
25 | protected function mockElasticEmailAPIRequest(&$container = [], $key = 'key') |
|
26 | { |
|
@@ 25-33 (lines=9) @@ | ||
22 | return new Client($key, [$history], $mockHandler); |
|
23 | } |
|
24 | ||
25 | protected function mockElasticEmailAPIRequest(&$container = [], $key = 'key') |
|
26 | { |
|
27 | $history = Middleware::history($container); |
|
28 | $mockHandler = new MockHandler([ |
|
29 | new Response(200, [], json_encode(['success' => true])), |
|
30 | ]); |
|
31 | ||
32 | return new Client($key, [$history], $mockHandler); |
|
33 | } |
|
34 | ||
35 | protected function assertMiddlewarePushed($container = []) |
|
36 | { |