1 | <?php |
||
13 | trait RequestTestable |
||
14 | { |
||
15 | /** |
||
16 | * Create an instance of Illuminate\Http\Request for testing. |
||
17 | * @param string $uri |
||
18 | * @param string $method |
||
19 | * @param array $parameters |
||
20 | * @param array $cookies |
||
21 | * @param array $files |
||
22 | * @param array $server |
||
23 | * @param null $content |
||
24 | * @return Request |
||
25 | */ |
||
26 | public function getRequestForTest( |
||
39 | |||
40 | /** |
||
41 | * Create an instance of Illuminate\Http\Request for testing. |
||
42 | * @param string $uri |
||
43 | * @param string $method |
||
44 | * @param array $parameters |
||
45 | * @param array $cookies |
||
46 | * @param array $files |
||
47 | * @param array $server |
||
48 | * @param null $content |
||
49 | * @return Request |
||
50 | */ |
||
51 | public function getRequestAndBindItForTest( |
||
70 | |||
71 | /** |
||
72 | * @param Request $request |
||
73 | * @return Request |
||
74 | */ |
||
75 | public function bindRequestForTest(Request $request): Request |
||
82 | |||
83 | /** |
||
84 | * Get request for upload file and bind. |
||
85 | * Usefull for testing upload. |
||
86 | * @param UploadedFile[] $arrUploadedFiles are in the form ['image' => $UploadFile1, 'file' => $UploadFile2,....] |
||
87 | * @return Request |
||
88 | */ |
||
89 | public function getRequestAndBindItForUploadTest(array $arrUploadedFiles) : Request |
||
94 | } |
||
95 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: