testUpdateCollectionForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Dynamic\Products\Test\Extension;
4
5
use Dynamic\ProductCatalog\Page\ProductDocCollectionController;
0 ignored issues
show
Bug introduced by
The type Dynamic\ProductCatalog\P...DocCollectionController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Dynamic\Products\Model\Brochure;
7
use Dynamic\Products\Page\ProductFileCollection;
8
use Dynamic\Products\Page\ProductFileCollectionController;
9
use SilverStripe\Dev\SapphireTest;
10
11
class ProductFileCollectionDataExtensionTest extends SapphireTest
12
{
13
    /**
14
     * @var string
15
     */
16
    protected static $fixture_file = '../fixtures.yml';
17
18
    /**
19
     *
20
     */
21
    public function testUpdateCollectionObject()
22
    {
23
        $object = $this->objFromFixture(ProductFileCollection::class, 'default');
24
        $controller = ProductFileCollectionController::create($object);
25
        $this->assertEquals($controller->getCollectionObject(), Brochure::class);
26
    }
27
28
    /**
29
     *
30
     */
31
    public function testUpdateCollectionForm()
32
    {
33
        $object = $this->objFromFixture(ProductFileCollection::class, 'default');
34
        $controller = ProductFileCollectionController::create($object);
35
        $form = $controller->CollectionSearchForm();
36
        $this->assertNotNull($form->Fields()->dataFieldByName('CategoryID'));
37
        $this->assertNull($form->Fields()->dataFieldByName('Title'));
38
    }
39
40
    /**
41
     *
42
     */
43
    public function testUpdateCollectionItems()
44
    {
45
        $this->markTestIncomplete(
46
            'This test has not been implemented yet.'
47
        );
48
    }
49
}
50