false, 'bodyOptions' => [ 'class' => 'offcanvas-body test', 'style' => [ 'text-align' => 'center', ], ], ]); $expected = <<
HTML; $this->assertEqualsWithoutLE($expected, $out); } public function testOptions() { Offcanvas::$counter = 0; ob_start(); Offcanvas::begin([ 'title' => 'Offcanvas title', 'headerOptions' => [ 'data-test' => 'Test', ], 'titleOptions' => [ 'tag' => 'h2', ], 'placement' => Offcanvas::PLACEMENT_END, 'backdrop' => false, 'scrolling' => true, 'closeButton' => false, ]); echo '

Woohoo, you\'re reading this text in an offcanvas!

'; Offcanvas::end(); $out = ob_get_clean(); $expected = <<

Offcanvas title

Woohoo, you're reading this text in an offcanvas!

HTML; $this->assertEqualsWithoutLE($expected, $out); } public function testTriggerButton() { Offcanvas::$counter = 0; ob_start(); Offcanvas::begin([ 'toggleButton' => [ 'class' => ['btn', 'btn-primary'], 'label' => 'Launch demo offcanvas', ], 'title' => 'Offcanvas title', ]); echo '

Woohoo, you\'re reading this text in an offcanvas!

'; Offcanvas::end(); $out = ob_get_clean(); $this->assertStringContainsString( '', $out, ); } }