| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | trait HttpCaller |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * HTTP client for requests to the application. |
||
| 23 | * |
||
| 24 | * @var HttpClient |
||
| 25 | */ |
||
| 26 | private $httpClient; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Call a HTTP resource from your test. |
||
| 30 | * |
||
| 31 | * @param string $uri HTTP URI, domain and port are added from the embedding class if not specified |
||
| 32 | * @param array $headers HTTP headers |
||
| 33 | * @param string $method HTTP method |
||
| 34 | * |
||
| 35 | * @return ResponseInterface |
||
| 36 | */ |
||
| 37 | 33 | protected function getResponse($uri, array $headers = [], $method = 'GET') |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the default host name to use. |
||
| 48 | * |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | abstract protected function getHostName(); |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Get the default port to use. |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | abstract protected function getCachingProxyPort(); |
||
| 59 | } |
||
| 60 |