Code Duplication    Length = 23-24 lines in 2 locations

tests/OSMPointOfInterestExtensionTest.php 1 location

@@ 3-25 (lines=23) @@
1
<?php
2
3
class OSMPointOfInterestExtensionTest extends SapphireTest
4
{
5
    public function setUpOnce()
6
    {
7
        $this->requiredExtensions = array(
8
            'OSMTestPageTO' => array('MapExtension', 'OSMPointOfInterestExtension'),
9
        );
10
        parent::setUpOnce();
11
    }
12
13
    public function testUpdateCMSFields()
14
    {
15
        $page = new OSMTestPageTO();
16
        $fields = $page->getCMSFields();
17
        $tab = $fields->findOrMakeTab('Root.Main');
18
        $fields = $tab->FieldList();
19
        $names = array();
20
        foreach ($fields as $field) {
21
            $names[] = $field->getName();
22
        }
23
        $this->assertNotContains('OpenStreetMapID', $names);
24
    }
25
}
26
27
class OSMTestPageTO extends Page implements TestOnly
28
{

tests/PointsOfInterestLayerExtensionTest.php 1 location

@@ 3-26 (lines=24) @@
1
<?php
2
3
    class PointsOfInterestLayerExtensionTest extends SapphireTest
4
    {
5
        public function setUpOnce()
6
        {
7
            $this->requiredExtensions = array(
8
            'POILayerExtensionPageTO' => array('MapExtension', 'PointsOfInterestLayerExtension'),
9
        );
10
            parent::setUpOnce();
11
        }
12
13
        public function testUpdateCMSFields()
14
        {
15
            $page = new POILayerExtensionPageTO();
16
            $fields = $page->getCMSFields();
17
            $tab = $fields->findOrMakeTab('Root.MapLayers');
18
            $fields = $tab->FieldList();
19
            $names = array();
20
            foreach ($fields as $field) {
21
                $names[] = $field->getName();
22
            }
23
24
            $this->assertEquals(array('POI Layers'), $names);
25
        }
26
    }
27
28
class POILayerExtensionPageTO extends Page implements TestOnly
29
{