false, 'bodyOptions' => ['class' => 'modal-body test', 'style' => 'text-align:center;'] ]); $expected = << HTML; $this->assertEqualsWithoutLE($expected, $out); } /** */ public function testContainerOptions() { Modal::$counter = 0; ob_start(); Modal::begin([ 'title' => 'Modal title', 'footer' => Html::button('Close', [ 'type' => 'button', 'class' => ['btn', 'btn-secondary'], 'data' => [ 'dismiss' => 'modal' ] ]) . "\n" . Html::button('Save changes', [ 'type' => 'button', 'class' => ['btn', 'btn-primary'] ]) ]); echo '

Woohoo, you\'re reading this text in a modal!

'; Modal::end(); $out = ob_get_clean(); $expected = << HTML; $this->assertEqualsWithoutLE($expected, $out); } public function testTriggerButton() { Modal::$counter = 0; ob_start(); Modal::begin([ 'toggleButton' => [ 'class' => ['btn', 'btn-primary'], 'label' => 'Launch demo modal' ], 'title' => 'Modal title', 'footer' => Html::button('Close', [ 'type' => 'button', 'class' => ['btn', 'btn-secondary'] ]) . "\n" . Html::button('Save changes', [ 'type' => 'button', 'class' => ['btn', 'btn-primary'] ]) ]); echo '

Woohoo, you\'re reading this text in a modal!

'; Modal::end(); $out = ob_get_clean(); $this->assertContains( '', $out ); } public function testDialogOptions() { Modal::$counter = 0; $out = Modal::widget([ 'closeButton' => false, 'dialogOptions' => ['class' => 'test', 'style' => 'text-align:center;'] ]); $expected = << HTML; $this->assertEqualsWithoutLE($expected, $out); } public function testCenterVertical() { Modal::$counter = 0; $out = Modal::widget([ 'closeButton' => false, 'centerVertical' => true ]); $expected = << HTML; $this->assertEqualsWithoutLE($expected, $out); } public function testScrollable() { Modal::$counter = 0; $out = Modal::widget([ 'closeButton' => false, 'scrollable' => true ]); $expected = << HTML; $this->assertEqualsWithoutLE($expected, $out); } }