Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 13 |
Ratio | 100 % |
1 | <?php |
||
5 | View Code Duplication | public function testGetCMSFields() |
|
6 | { |
||
7 | $gf = new GalleryFolder(); |
||
8 | $tab = $gf->getCMSFields()->fieldByName('Root.Main'); |
||
9 | $fields = $tab->FieldList(); |
||
10 | $names = array(); |
||
11 | foreach ($fields as $field) { |
||
12 | array_push($names, $field->getName()); |
||
13 | } |
||
14 | $expected = array('InstallWarningHeader', 'Title', 'URLSegment', |
||
15 | 'MenuTitle', 'BriefIntroduction', 'Content'); |
||
16 | $this->assertEquals($expected, $names); |
||
17 | } |
||
18 | |||
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.