Completed
Pull Request — master (#62)
by Jason
17:50 queued 02:52
created

BlocksSlideImageDataExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetCMSFields() 0 10 1
1
<?php
2
3
namespace Dynamic\DynamicBlocks\Test;
4
5
use Dynamic\DynamicBlocks\ORM\DynamicContentBlockDataExtension;
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\ORM\DataExtension;
8
9
class BlocksSlideImageDataExtensionTest extends DataExtension
10
{
11
    /**
12
     * @var string
13
     */
14
    protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml';
15
16
    /**
17
     *
18
     */
19
    public function testGetCMSFields()
20
    {
21
        $object = $this->objFromFixture('SlideImage', 'one');
0 ignored issues
show
Bug introduced by
The method objFromFixture() does not seem to exist on object<Dynamic\DynamicBl...ImageDataExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
        $fields = $object->getCMSFields();
23
        $extension = new DynamicContentBlockDataExtension();
24
        $extension->updateCMSFields($fields);
25
26
        $this->assertInstanceOf(FieldList::class, $fields);
27
        $this->assertNotNull($fields->dataFieldByName('SlideshowBlock'));
0 ignored issues
show
Bug introduced by
The method assertNotNull() does not seem to exist on object<Dynamic\DynamicBl...ImageDataExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
    }
29
}