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

testGetCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 2
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
}