Completed
Push — master ( a10f05...2ab214 )
by Jason
9s
created

ProductHolderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetCMSFields() 0 10 1
A testProducts() 0 6 1
1
<?php
2
3
class ProductHolderTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'foxystripe/tests/FoxyStripeTest.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = singleton('ProductHolder');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
19
        $object = $this->objFromFixture('ProductHolder', 'default');
20
        $fields = $object->getCMSFields();
21
        $this->assertInstanceOf('FieldList', $fields);
22
    }
23
24
    /**
25
     *
26
     */
27
    public function testProducts()
28
    {
29
        $object = $this->objFromFixture('ProductHolder', 'default');
30
        $this->assertInstanceOf('SS_List', $object->Products());
31
        $this->assertEquals($object->Products(), $object->getManyManyComponents('Products')->sort('SortOrder'));
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProductHolderTest>.

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...
32
    }
33
}