2018-10-20 19:49:21 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Forms\Tests;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
use SilverStripe\Forms\PrintableTransformation_TabSet;
|
|
|
|
use SilverStripe\Forms\Tab;
|
|
|
|
use SilverStripe\Forms\TabSet;
|
|
|
|
|
2018-11-10 13:55:11 +01:00
|
|
|
class PrintableTransformationTabSetTest extends SapphireTest
|
2018-10-20 19:49:21 +02:00
|
|
|
{
|
|
|
|
public function testFieldHolder()
|
|
|
|
{
|
|
|
|
$tabs = [
|
|
|
|
new Tab('Main'),
|
|
|
|
new Tab('Secondary'),
|
|
|
|
$optionsTabSet = new TabSet(
|
|
|
|
'Options',
|
|
|
|
'Options',
|
|
|
|
new Tab('Colours'),
|
|
|
|
new Tab('Options')
|
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
$transformationTabSet = new PrintableTransformation_TabSet($tabs);
|
|
|
|
$result = $transformationTabSet->FieldHolder();
|
|
|
|
|
2021-10-27 04:39:47 +02:00
|
|
|
$this->assertStringContainsString('<h1>Main</h1>', $result);
|
|
|
|
$this->assertStringContainsString('<h1>Secondary</h1>', $result);
|
2018-10-20 19:49:21 +02:00
|
|
|
|
|
|
|
$transformationTabSet->setTabSet($optionsTabSet);
|
|
|
|
$result = $transformationTabSet->FieldHolder();
|
|
|
|
|
2021-10-27 04:39:47 +02:00
|
|
|
$this->assertStringContainsString('<h2>Options</h2>', $result);
|
2018-10-20 19:49:21 +02:00
|
|
|
}
|
|
|
|
}
|