Completed
Push — 3.1 ( 6c19c5...97d1e4 )
by Gordon
04:55
created

testUpdateCMSFields()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 9

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 11
CRAP Score 2
Metric Value
dl 13
loc 13
ccs 11
cts 11
cp 1
rs 9.4286
cc 2
eloc 9
nc 2
nop 0
crap 2
1
<?php
2
3 View Code Duplication
    class PointsOfInterestLayerExtensionTest extends SapphireTest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
Line indented incorrectly; expected 0 spaces, found 4
Loading history...
4
    {
5
        public function setUpOnce()
6
        {
7
            $this->requiredExtensions = array(
8
            'POILayerExtensionPageTO' => array('MapExtension', 'PointsOfInterestLayerExtension'),
9
        );
0 ignored issues
show
Coding Style introduced by
It seems like the identation of this line is off (expected at least 12 spaces, but found 8).
Loading history...
10
            parent::setUpOnce();
11
        }
12
13 1
        public function testUpdateCMSFields()
14
        {
15 1
            $page = new POILayerExtensionPageTO();
16 1
            $fields = $page->getCMSFields();
17 1
            $tab = $fields->findOrMakeTab('Root.MapLayers');
18 1
            $fields = $tab->FieldList();
19 1
            $names = array();
20 1
            foreach ($fields as $field) {
21 1
                $names[] = $field->getName();
22 1
            }
23
24 1
            $this->assertEquals(array('POI Layers'), $names);
25 1
        }
26
    }
27
28
class POILayerExtensionPageTO extends Page implements TestOnly
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 0
Loading history...
29
{
0 ignored issues
show
Coding Style introduced by
It seems like the identation of this line is off (expected at least 4 spaces, but found 0).
Loading history...
30
}
31