Files
piratepoet/tests/unit/Newsletter/Renderer/Blocks/SpacerTest.php
Rostislav Wolny 9c0d39e74b Add test for spacer renderer
[MAILPOET-2086]
2019-05-20 13:14:43 -04:00

35 lines
871 B
PHP

<?php
namespace MailPoet\Newsletter\Renderer\Blocks;
class SpacerTest extends \MailPoetUnitTest {
private $block = [
'type' => 'spacer',
'styles' => [
'block' => [
'backgroundColor' => 'transparent',
'height' => '13px',
],
],
];
function testItRendersCorrectly() {
$output = Spacer::render($this->block);
$expected_result = '
<tr>
<td class="mailpoet_spacer" height="13" valign="top"></td>
</tr>';
expect($output)->equals($expected_result);
}
function testsItRendersWithBackground() {
$this->block['styles']['block']['backgroundColor'] = "#ffffff";
$output = Spacer::render($this->block);
$expected_result = '
<tr>
<td class="mailpoet_spacer" bgcolor="#ffffff" height="13" valign="top"></td>
</tr>';
expect($output)->equals($expected_result);
}
}