| Total Complexity | 8 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Response |
||
| 8 | { |
||
| 9 | private $chain; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Response constructor. |
||
| 13 | * |
||
| 14 | * @param $chain |
||
| 15 | */ |
||
| 16 | 19 | public function __construct(Chain $chain) |
|
| 19 | 19 | } |
|
| 20 | |||
| 21 | 2 | public function redirect($url, $status = null) |
|
| 22 | { |
||
| 23 | 2 | $this->addAssertion('assertRedirect', $url); |
|
| 24 | |||
| 25 | 2 | if (!is_null($status)) { |
|
| 26 | 2 | $this->statusCode($status); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $this; |
|
| 30 | } |
||
| 31 | |||
| 32 | 17 | public function statusCode($code) |
|
| 33 | { |
||
| 34 | 17 | $this->addAssertion('assertStatus', $code); |
|
| 35 | |||
| 36 | 17 | return $this; |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | public function success() |
|
| 42 | 2 | } |
|
| 43 | |||
| 44 | 1 | public function withError($value) |
|
| 45 | { |
||
| 46 | 1 | $this->addAssertion('assertSessionHasErrors', $value); |
|
| 47 | |||
| 48 | 1 | return $this; |
|
| 49 | } |
||
| 50 | |||
| 51 | 9 | public function forbiddenStatus() |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param $value |
||
| 58 | * @param $type |
||
| 59 | */ |
||
| 60 | public function addAssertion($type, $value = null) |
||
| 65 |