1 | <?php |
||
12 | class MockClient extends Client |
||
13 | { |
||
14 | /** @var MockResponse */ |
||
15 | protected $mockResponse; |
||
16 | |||
17 | /** @var ResponseInterface */ |
||
18 | protected $response; |
||
19 | |||
20 | /** @var mixed */ |
||
21 | protected $mockBody; |
||
22 | |||
23 | /** @var array<mixed> */ |
||
24 | protected $mockInfo = []; |
||
25 | |||
26 | /** |
||
27 | * @param mixed $body |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function mockBody($body): self |
||
37 | |||
38 | /** |
||
39 | * @param array<mixed> $info |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function mockInfo(array $info): self |
||
49 | |||
50 | /** |
||
51 | * @return MockResponse |
||
52 | */ |
||
53 | protected function buildMockResponse(): MockResponse |
||
60 | |||
61 | /** |
||
62 | * @return ResponseInterface |
||
63 | */ |
||
64 | public function getMockResponse(): ResponseInterface |
||
68 | /** |
||
69 | * @param string $method |
||
70 | * @param string $endpoint |
||
71 | * |
||
72 | * @return Response|mixed |
||
73 | * |
||
74 | * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface |
||
75 | */ |
||
76 | protected function request(string $method, string $endpoint) |
||
85 | |||
86 | /** |
||
87 | * @return array<mixed> |
||
88 | */ |
||
89 | protected function mergeConfigAndOptions(): array |
||
98 | |||
99 | /** |
||
100 | * @return array<mixed> |
||
101 | */ |
||
102 | public function getRequestOptions(): array |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | protected function getBaseUri() |
||
118 | |||
119 | /** |
||
120 | * @return array<mixed> |
||
121 | */ |
||
122 | protected function getConfig(): array |
||
128 | } |
||
129 |