Completed
Pull Request — master (#1)
by Jason
05:59
created

ProductDocDataExtensionTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProductsCt() 0 5 1
A testGetProductsList() 0 5 1
A testGetCMSFields() 0 6 1
A testLink() 0 5 1
A testGetIsProductDoc() 0 5 1
1
<?php
2
3
class ProductDocDataExtensionTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'product-catalog/tests/fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetProductsCt()
14
    {
15
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
16
        $this->assertEquals($object->getProductsCt(), 1);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProductDocDataExtensionTest>.

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...
17
    }
18
19
    /**
20
     *
21
     */
22
    public function testGetProductsList()
23
    {
24
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
25
        $this->assertEquals($object->getProductsList(), 'Product One');
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProductDocDataExtensionTest>.

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...
26
    }
27
28
    /**
29
     *
30
     */
31
    public function testGetCMSFields()
32
    {
33
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
34
        $fields = $object->getCMSFields();
35
        $this->assertInstanceOf('FieldList', $fields);
36
    }
37
38
    /**
39
     *
40
     */
41
    public function testLink()
42
    {
43
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
44
        $this->assertEquals($object->Link(), $object->Download()->URL);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProductDocDataExtensionTest>.

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...
45
    }
46
47
    /**
48
     *
49
     */
50
    public function testGetIsProductDoc()
51
    {
52
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
53
        $this->assertEquals($object->getIsProductDoc(), true);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProductDocDataExtensionTest>.

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...
54
    }
55
}
56