Passed
Push — fix-6460 ( 379c3e...254990 )
by Sam
09:57
created

PrintableTransformationTabSetTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFieldHolder() 0 23 1
1
<?php
2
3
namespace SilverStripe\Forms\Tests;
4
5
use SilverStripe\Dev\SapphireTest;
6
use SilverStripe\Forms\PrintableTransformation_TabSet;
7
use SilverStripe\Forms\Tab;
8
use SilverStripe\Forms\TabSet;
9
10
class PrintableTransformationTabSetTest extends SapphireTest
11
{
12
    public function testFieldHolder()
13
    {
14
        $tabs = [
15
            new Tab('Main'),
16
            new Tab('Secondary'),
17
            $optionsTabSet = new TabSet(
18
                'Options',
19
                'Options',
20
                new Tab('Colours'),
21
                new Tab('Options')
22
            ),
23
        ];
24
25
        $transformationTabSet = new PrintableTransformation_TabSet($tabs);
26
        $result = $transformationTabSet->FieldHolder();
27
28
        $this->assertContains('<h1>Main</h1>', $result);
29
        $this->assertContains('<h1>Secondary</h1>', $result);
30
31
        $transformationTabSet->setTabSet($optionsTabSet);
32
        $result = $transformationTabSet->FieldHolder();
33
34
        $this->assertContains('<h2>Options</h2>', $result);
35
    }
36
}
37