Code Duplication    Length = 18-20 lines in 6 locations

tests/AccordionBlockTest.php 1 location

@@ 3-20 (lines=18) @@
1
<?php
2
3
class AccordionBlockTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = $this->objFromFixture('AccordionBlock', 'one');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNotNull($fields->dataFieldByName('Panels'));
19
    }
20
}
21

tests/ImageBlockTest.php 1 location

@@ 3-20 (lines=18) @@
1
<?php
2
3
class ImageBlockTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = singleton('ImageBlock');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNotNull($fields->dataFieldByName('Image'));
19
    }
20
}

tests/PromoObjectTest.php 1 location

@@ 3-20 (lines=18) @@
1
<?php
2
3
class PromoObjectTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = $this->objFromFixture('PromoObject', 'one');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNotNull($fields->dataFieldByName('PromoBlocks'));
19
    }
20
}

tests/VideoBlockTest.php 1 location

@@ 3-20 (lines=18) @@
1
<?php
2
3
class VideoBlockTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = $this->objFromFixture('VideoBlock', 'one');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNotNull($fields->dataFieldByName('VideoID'));
19
    }
20
}

tests/PageSectionBlockTest.php 1 location

@@ 6-25 (lines=20) @@
3
/**
4
 * Class PageSectionBlockTest
5
 */
6
class PageSectionBlockTest extends SapphireTest
7
{
8
9
    /**
10
     * @var string
11
     */
12
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
13
14
    /**
15
     *
16
     */
17
    public function testGetCMSFields()
18
    {
19
        $object = $this->objFromFixture('PageSectionBlock', 'one');
20
        $fields = $object->getCMSFields();
21
        $this->assertInstanceOf('FieldList', $fields);
22
        $this->assertNotNull($fields->dataFieldByName('Sections'));
23
    }
24
25
}

tests/CallToActionBlockTest.php 1 location

@@ 3-20 (lines=18) @@
1
<?php
2
3
class CallToActionBlockTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = $this->objFromFixture('CallToActionBlock', 'one');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNotNull($fields->dataFieldByName('BlockLinkID'));
19
    }
20
}
21