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

@ -10,9 +10,9 @@ class HtmlTest extends \MailPoetUnitTest {
private $html;
private $block = [
'type' => 'divider',
'name' => 'Divider',
'id' => 'divider',
'type' => 'html',
'name' => 'Html',
'id' => 'html',
'unique' => '1',
'static' => '0',
'params' => [
@ -32,6 +32,13 @@ class HtmlTest extends \MailPoetUnitTest {
expect($html)->equals("<div class=\"mailpoet_paragraph\" >line1<br />\nline2</div>");
}
public function testItShouldRenderCustomClass() {
$block = $this->block;
$block['params']['class_name'] = 'my_class';
$html = $this->html->render($block, []);
expect($html)->equals("<div class=\"mailpoet_paragraph my_class\" >line1<br />\nline2</div>");
}
public function testItShouldRenderCustomHtmlWithoutAutomaticBrs() {
$block = $this->block;
$block['params']['nl2br'] = '';