Passed
Push — nested-vendor ( f8843a )
by Sam
09:43
created

testFieldHolder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 23
rs 9.7666
c 0
b 0
f 0
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