Completed
Pull Request — master (#287)
by Nic
07:49
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 testPaginatedProducts() 0 6 1
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
}