DropdownTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetType() 0 4 1
A testGetCMSFields() 0 9 1
1
<?php
2
3
namespace SilverStripe\CKANRegistry\Tests\Model\ResourceFilter;
4
5
use SilverStripe\CKANRegistry\Model\ResourceFilter\Dropdown;
6
use SilverStripe\Dev\SapphireTest;
7
use SilverStripe\Forms\TextField;
8
9
class DropdownTest extends SapphireTest
10
{
11
    protected $usesDatabase = true;
12
13
    public function testGetCMSFields()
14
    {
15
        $field = new Dropdown();
16
        $fields = $field->getCMSFields();
17
18
        $this->assertInstanceOf(
19
            TextField::class,
20
            $fields->dataFieldByName('Options'),
21
            'Options field should exist'
22
        );
23
    }
24
25
    public function testGetType()
26
    {
27
        $field = new Dropdown();
28
        $this->assertSame('Dropdown', $field->getType());
29
    }
30
}
31