ProductDocCollectionDataExtensionTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testUpdateCollectionItems() 0 4 1
A testUpdateCollectionObject() 0 5 1
A testUpdateCollectionForm() 0 7 1
1
<?php
2
3
namespace Dynamic\ProductCatalog\Test;
4
5
use Dynamic\ProductCatalog\Page\ProductDocCollectionController;
6
use Dynamic\ProductCatalog\Docs\SpecSheet;
7
use Dynamic\ProductCatalog\Page\ProductDocCollection;
8
use SilverStripe\Dev\SapphireTest;
9
10
class ProductDocCollectionDataExtensionTest extends SapphireTest
11
{
12
    /**
13
     * @var string
14
     */
15
    protected static $fixture_file = 'fixtures.yml';
16
17
    /**
18
     *
19
     */
20
    public function testUpdateCollectionObject()
21
    {
22
        $object = $this->objFromFixture(ProductDocCollection::class, 'default');
23
        $controller = ProductDocCollectionController::create($object);
24
        $this->assertEquals($controller->getCollectionObject(), SpecSheet::class);
25
    }
26
27
    /**
28
     *
29
     */
30
    public function testUpdateCollectionForm()
31
    {
32
        $object = $this->objFromFixture(ProductDocCollection::class, 'default');
33
        $controller = ProductDocCollectionController::create($object);
34
        $form = $controller->CollectionSearchForm();
35
        $this->assertNotNull($form->Fields()->dataFieldByName('CategoryID'));
36
        $this->assertNull($form->Fields()->dataFieldByName('Title'));
37
    }
38
39
    /**
40
     *
41
     */
42
    public function testUpdateCollectionItems()
43
    {
44
        $this->markTestIncomplete(
45
            'This test has not been implemented yet.'
46
        );
47
    }
48
}
49