Files
piratepoet/tests/unit/Form/Block/DividerTest.php
Rostislav Wolny 060a6839c7 Render form block custom classes on frontend
[MAILPOET-2746]
2020-03-21 09:40:46 +01:00

37 lines
845 B
PHP

<?php
namespace MailPoet\Test\Form\Block;
use MailPoet\Form\Block\Divider;
class DividerTest extends \MailPoetUnitTest {
/** @var Divider */
private $divider;
private $block = [
'type' => 'divider',
'name' => 'Divider',
'id' => 'divider',
'unique' => '1',
'static' => '0',
'params' => [],
'position' => '1',
];
public function _before() {
parent::_before();
$this->divider = new Divider();
}
public function testItShouldRenderDivider() {
$html = $this->divider->render($this->block);
expect($html)->equals('<hr class="mailpoet_divider" />');
}
public function testItShouldRenderCustomClass() {
$this->block['params']['class_name'] = 'my_class';
$html = $this->divider->render($this->block);
expect($html)->equals('<hr class="mailpoet_divider my_class" />');
}
}