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

OSMPointOfInterestExtensionTest::setUpOnce()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 7
loc 7
ccs 0
cts 5
cp 0
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3 View Code Duplication
class OSMPointOfInterestExtensionTest 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...
4
{
5
    public function setUpOnce()
6
    {
7
        $this->requiredExtensions = array(
8
            'OSMTestPageTO' => array('MapExtension', 'OSMPointOfInterestExtension'),
9
        );
10
        parent::setUpOnce();
11
    }
12
13 1
    public function testUpdateCMSFields()
14
    {
15 1
        $page = new OSMTestPageTO();
16 1
        $fields = $page->getCMSFields();
17 1
        $tab = $fields->findOrMakeTab('Root.Main');
18 1
        $fields = $tab->FieldList();
19 1
        $names = array();
20 1
        foreach ($fields as $field) {
21 1
            $names[] = $field->getName();
22 1
        }
23 1
        $this->assertNotContains('OpenStreetMapID', $names);
24 1
    }
25
}
26
27
class OSMTestPageTO extends Page implements TestOnly
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
28
{
29
}
30