1 | <?php |
||
2 | |||
3 | namespace Sfneal\Testing\Utils\Traits; |
||
4 | |||
5 | use Illuminate\Testing\TestResponse; |
||
6 | |||
7 | trait WithResponse |
||
8 | { |
||
9 | /** |
||
10 | * @var string Name of the route |
||
11 | */ |
||
12 | protected $routeName; |
||
13 | |||
14 | /** |
||
15 | * @var array Params to pass to the route |
||
16 | */ |
||
17 | protected $routeParams = []; |
||
18 | |||
19 | /** |
||
20 | * @var TestResponse |
||
21 | */ |
||
22 | protected $response; |
||
23 | |||
24 | /** |
||
25 | * Retrieve a 'GET' response using route & params. |
||
26 | * |
||
27 | * @return TestResponse |
||
28 | */ |
||
29 | protected function getResponse(): TestResponse |
||
30 | { |
||
31 | return $this->get(route($this->routeName, $this->routeParams)); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
32 | } |
||
33 | } |
||
34 |