'html',
'name' => 'Html',
'id' => 'html',
'unique' => '1',
'static' => '0',
'params' => [
'nl2br' => '1',
'text' => "line1\nline2",
],
'position' => '1',
];
public function _before() {
parent::_before();
$this->html = new Html($this->createMock(BlockRendererHelper::class));
}
public function testItShouldRenderCustomHtml() {
$html = $this->html->render($this->block, []);
expect($html)->equals("
line1
\nline2
");
}
public function testItShouldRenderCustomClass() {
$block = $this->block;
$block['params']['class_name'] = 'my_class';
$html = $this->html->render($block, []);
expect($html)->equals("line1
\nline2
");
}
public function testItShouldRenderCustomHtmlWithoutAutomaticBrs() {
$block = $this->block;
$block['params']['nl2br'] = '';
$html = $this->html->render($block, []);
expect($html)->equals("line1\nline2
");
}
public function testItShouldNotEscapeHtml() {
$block = $this->block;
$block['params']['text'] = 'Hello
';
$html = $this->html->render($block, []);
expect($html)->equals("");
}
}