1 | <?php |
||
18 | abstract class Base extends PHPUnit_Framework_TestCase |
||
19 | { |
||
20 | /** |
||
21 | * @var ClientInterface |
||
22 | */ |
||
23 | protected $httpClient; |
||
24 | |||
25 | /** |
||
26 | * Get a mock response for a client by mock file name |
||
27 | * |
||
28 | * @param string $path Relative path to the mock response file |
||
29 | * @param string $code HTTP response code to respond with |
||
30 | * |
||
31 | * @return Response |
||
32 | */ |
||
33 | public function getMockHttpResponse($path, $code = 200) |
||
45 | |||
46 | /** |
||
47 | * Get Guzzle with mock response and request history stored in container |
||
48 | * |
||
49 | * @param array $container |
||
50 | * @param Response[] $responses |
||
51 | * @return Client |
||
52 | */ |
||
53 | public function getMockHttpClientWithHistoryAndResponses(&$container, $responses) |
||
63 | |||
64 | /** |
||
65 | * Get HTTP Client or default one if none set |
||
66 | * |
||
67 | * @return ClientInterface Client |
||
68 | */ |
||
69 | public function getHttpClient() |
||
77 | } |
||
78 |