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

ProductHolderTest::testGetCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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