Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
4 | public function setUp() { |
||
5 | parent::setUp(); |
||
6 | |||
7 | $folder = Folder::find_or_make('/TestImageSS3Gallery/'); |
||
8 | $testfilePath = 'assets/TestImageSS3Gallery/test.jpg'; // Important: No leading slash |
||
9 | |||
10 | $sourcePath = getcwd() . '/ss3gallery/tests/test.jpg'; |
||
11 | copy($sourcePath, $testfilePath); |
||
12 | |||
13 | $image = new Image(); |
||
14 | $image->Title = 'Test Image'; |
||
15 | $image->Filename = $testfilePath; |
||
16 | // TODO This should be auto-detected |
||
17 | $image->ParentID = $folder->ID; |
||
18 | $image->write(); |
||
19 | } |
||
20 | |||
26 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.