Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function setUp() |
||
|
|||
13 | { |
||
14 | $faker = Factory::create(); |
||
15 | $file = $faker->image(); |
||
16 | $_FILES = [ |
||
17 | 'FileLoaderBehaviorMock' => [ |
||
18 | 'name' => [ |
||
19 | 'file' => $faker->name, |
||
20 | ], |
||
21 | 'type' => [ |
||
22 | 'file' => 'application/octet-stream', |
||
23 | ], |
||
24 | 'tmp_name' => [ |
||
25 | 'file' => $file, |
||
26 | ], |
||
27 | 'error' => [ |
||
28 | 'file' => 0, |
||
29 | ], |
||
30 | 'size' => [ |
||
31 | 'file' => filesize($file), |
||
32 | ], |
||
33 | ], |
||
34 | ]; |
||
35 | return parent::setUp(); |
||
36 | } |
||
37 | |||
55 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: