'1',
'type' => 'column',
'params' => [],
];
public function _before() {
parent::_before();
$this->columns = new Column();
$this->htmlParser = new HtmlParser();
}
public function testItShouldRenderColumn() {
$html = $this->columns->render($this->block, 'content');
expect($html)->equals('
content
');
}
public function testItShouldRenderWidth() {
$block = $this->block;
$block['params']['width'] = 30;
$html = $this->columns->render($block, 'content');
$column = $this->htmlParser->getElementByXpath($html, '//div[@class="mailpoet_form_column"]');
$style = $this->htmlParser->getAttribute($column, 'style');
expect($style->textContent)->contains('flex-basis:30%;');
}
public function testItShouldRenderVerticalAlignClass() {
$block = $this->block;
$block['params']['vertical_alignment'] = 'top';
$html = $this->columns->render($block, 'content');
$column = $this->htmlParser->getElementByXpath($html, '//div[1]');
$class = $this->htmlParser->getAttribute($column, 'class');
expect($class->textContent)->contains('mailpoet_vertically_align_top');
}
public function testItShouldRenderCustomClass() {
$block = $this->block;
$block['params']['class_name'] = 'my-class';
$html = $this->columns->render($block, 'content');
$column = $this->htmlParser->getElementByXpath($html, '//div[1]');
$class = $this->htmlParser->getAttribute($column, 'class');
expect($class->textContent)->contains('my-class');
}
}