Render form block custom classes on frontend

[MAILPOET-2746]
This commit is contained in:
Rostislav Wolny
2020-03-12 16:27:59 +01:00
committed by Veljko V
parent 72a0afa75b
commit 060a6839c7
7 changed files with 43 additions and 11 deletions

View File

@@ -8,13 +8,29 @@ 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();
$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" />');
}
}