| Total Complexity | 11 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 96.55% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class CheckExpectations |
||
| 6 | { |
||
| 7 | private $last; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * CheckExpectations constructor. |
||
| 11 | * |
||
| 12 | * @param $last |
||
| 13 | */ |
||
| 14 | 26 | public function __construct($last) |
|
| 17 | 26 | } |
|
| 18 | |||
| 19 | 26 | public function check() |
|
| 24 | 25 | } |
|
| 25 | |||
| 26 | 25 | private function checkResponse() |
|
| 27 | { |
||
| 28 | 25 | if (!$this->last->http) { |
|
| 29 | return; |
||
| 30 | } |
||
| 31 | 25 | $this->checkResponses($this->sendRequest()); |
|
| 32 | 25 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return mixed |
||
| 36 | */ |
||
| 37 | 25 | private function sendRequest() |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param $response |
||
| 48 | */ |
||
| 49 | 25 | private function checkResponses($response) |
|
| 50 | { |
||
| 51 | 25 | foreach ($this->last->assertion as $assertion) { |
|
| 52 | 25 | $type = $assertion['type']; |
|
| 53 | 25 | $response->$type($assertion['value']); |
|
| 54 | } |
||
| 55 | 25 | } |
|
| 56 | |||
| 57 | 26 | private function fireEvents() |
|
| 58 | { |
||
| 59 | 26 | if ($this->last->event) { |
|
| 60 | 1 | event($this->last->event); |
|
| 61 | } |
||
| 62 | 25 | } |
|
| 63 | |||
| 64 | 26 | private function expectExceptions() |
|
| 68 | } |
||
| 69 | 26 | } |
|
| 70 | } |
||
| 71 |