CatalogCategoryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetProductList() 0 4 1
A testGetCMSFields() 0 5 1
1
<?php
2
3
namespace Dynamic\ProductCatalog\Test;
4
5
use Dynamic\ProductCatalog\Page\CatalogCategory;
6
use SilverStripe\Dev\SapphireTest;
7
use SilverStripe\Forms\FieldList;
8
use SilverStripe\ORM\DataList;
9
10
class CatalogCategoryTest extends SapphireTest
11
{
12
    /**
13
     * @var string
14
     */
15
    protected static $fixture_file = 'fixtures.yml';
16
17
    /**
18
     *
19
     */
20
    public function testGetCMSFields()
21
    {
22
        $object = $this->objFromFixture(CatalogCategory::class, 'default');
23
        $fields = $object->getCMSFields();
24
        $this->assertInstanceOf(FieldList::class, $fields);
25
    }
26
27
    /**
28
     *
29
     */
30
    public function testGetProductList()
31
    {
32
        $object = $this->objFromFixture(CatalogCategory::class, 'default');
33
        $this->assertInstanceOf(DataList::class, $object->getProductList());
34
    }
35
}
36