| Total Complexity | 7 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 84.21% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Response |
||
| 6 | { |
||
| 7 | private $last; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Response constructor. |
||
| 11 | * |
||
| 12 | * @param $last |
||
| 13 | */ |
||
| 14 | 13 | public function __construct($last) |
|
| 15 | { |
||
| 16 | 13 | $this->last = $last; |
|
| 17 | 13 | } |
|
| 18 | |||
| 19 | 1 | public function redirect($url, $status = null) |
|
| 20 | { |
||
| 21 | 1 | $this->last->assertion[] = ['type' => 'assertRedirect', 'value' => $url]; |
|
| 22 | |||
| 23 | 1 | if (!is_null($status)) { |
|
| 24 | 1 | $this->last->assertion[] = ['type' => 'assertStatus', 'value' => $status]; |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | return $this; |
|
| 28 | } |
||
| 29 | |||
| 30 | 12 | public function statusCode($code) |
|
| 35 | } |
||
| 36 | |||
| 37 | public function success() |
||
| 38 | { |
||
| 39 | $this->last->assertion[] = ['type' => 'assertSuccessful', 'value' => null]; |
||
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function withError($value) |
|
| 43 | { |
||
| 44 | 1 | $this->last->assertion[] = ['type' => 'assertSessionHasErrors', 'value' => $value]; |
|
| 45 | |||
| 46 | 1 | return $this; |
|
| 47 | } |
||
| 48 | |||
| 49 | 8 | public function forbiddenStatus() |
|
| 52 | } |
||
| 53 | } |
||
| 54 |