[
[
'label' => 'Collapsible Group Item #1',
'content' => [
'test content1',
'test content2'
],
],
[
'label' => 'Collapsible Group Item #2',
'content' => [
'test content1',
'test content2'
],
'contentOptions' => [
'class' => 'testContentOptions'
],
'options' => [
'class' => 'testClass',
'id' => 'testId'
],
'footer' => 'Footer'
],
[
'label' => '
Collapsible Group Item #3
',
'content' => [
'test content1
',
'test content2
'
],
'contentOptions' => [
'class' => 'testContentOptions2'
],
'options' => [
'class' => 'testClass2',
'id' => 'testId2'
],
'encode' => false,
'footer' => 'Footer2'
],
[
'label' => 'Collapsible Group Item #4
',
'content' => [
'test content1
',
'test content2
'
],
'contentOptions' => [
'class' => 'testContentOptions3'
],
'options' => [
'class' => 'testClass3',
'id' => 'testId3'
],
'encode' => true,
'footer' => 'Footer3'
],
]
]);
$this->assertEqualsWithoutLE(<<
- test content1
- test content2
- test content1
- test content2
test content1
test content2
test content1
test content2
HTML
, $output);
}
/**
* @see https://github.com/yiisoft/yii2/issues/8357
*/
public function testRenderObject()
{
$template = ['template' => '{input}'];
ob_start();
$form = ActiveForm::begin(['action' => '/something']);
ActiveForm::end();
ob_end_clean();
$model = new data\Singer;
Collapse::$counter = 0;
$output = Collapse::widget([
'items' => [
[
'label' => 'Collapsible Group Item #1',
'content' => $form->field($model, 'firstName', $template)
],
]
]);
$this->assertEqualsWithoutLE(<<
HTML
, $output);
}
}