Completed
Pull Request — master (#287)
by Nic
07:49
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
/**
4
 * Class ProductHolderTest
5
 */
6
class ProductHolderTest extends SapphireTest
7
{
8
    /**
9
     * @var string
10
     */
11
    protected static $fixture_file = 'foxystripe/tests/FoxyStripeTest.yml';
12
13
    /**
14
     *
15
     */
16
    public function testGetCMSFields()
17
    {
18
        $object = singleton('ProductHolder');
19
        $fields = $object->getCMSFields();
20
        $this->assertInstanceOf('FieldList', $fields);
21
22
        $object = $this->objFromFixture('ProductHolder', 'default');
23
        $fields = $object->getCMSFields();
24
        $this->assertInstanceOf('FieldList', $fields);
25
    }
26
27
    /**
28
     *
29
     */
30
    public function testPaginatedProducts()
31
    {
32
        $holder = $this->objFromFixture('ProductHolder', 'two');
33
        $paginatedProducts = $holder->getPaginatedProducts();
34
        $this->assertInstanceOf('PaginatedList', $paginatedProducts);
35
    }
36
}