Completed
Pull Request — master (#62)
by Jason
12:32
created

ImageBlockTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetPluralName() 5 5 1
1
<?php
2
3
namespace Dynamic\DynamicBlocks\Test;
4
5
use Dynamic\DynamicBlocks\Block\ImageBlock;
6
use SilverStripe\Dev\SapphireTest;
7
use SilverStripe\Forms\FieldList;
8
9 View Code Duplication
class ImageBlockTest 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...
10
{
11
    /**
12
     * @var string
13
     */
14
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
15
16
    /**
17
     *
18
     */
19
    public function testGetPluralName()
20
    {
21
        $object = singleton(ImageBlock::class);
22
        $this->assertEquals('Image Blocks', $object->plural_name());
23
    }
24
25
    /**
26
     *
27
     */
28
    public function testGetCMSFields()
29
    {
30
        $object = singleton(ImageBlock::class);
31
        $fields = $object->getCMSFields();
32
        $this->assertInstanceOf(FieldList::class, $fields);
33
        $this->assertNotNull($fields->dataFieldByName('Image'));
34
    }
35
}