From 52eb29f7dd3d947ab75b79da6770576092f21134 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Thu, 16 May 2019 16:14:37 +0200 Subject: [PATCH] Add test for button renderer [MAILPOET-2086] --- .../Newsletter/Renderer/Blocks/ButtonTest.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/unit/Newsletter/Renderer/Blocks/ButtonTest.php diff --git a/tests/unit/Newsletter/Renderer/Blocks/ButtonTest.php b/tests/unit/Newsletter/Renderer/Blocks/ButtonTest.php new file mode 100644 index 0000000000..8407bed51c --- /dev/null +++ b/tests/unit/Newsletter/Renderer/Blocks/ButtonTest.php @@ -0,0 +1,62 @@ + 'button', + 'text' => 'Button', + 'url' => 'https://example.com', + 'styles' => [ + 'block' => [ + 'backgroundColor' => '#252525', + 'borderColor' => '#363636', + 'borderWidth' => '2px', + 'borderRadius' => '5px', + 'borderStyle' => 'solid', + 'width' => '180px', + 'lineHeight' => '40px', + 'fontColor' => '#ffffff', + 'fontFamily' => 'Source Sans Pro', + 'fontSize' => '14px', + 'fontWeight' => 'bold', + 'textAlign' => 'center', + ], + ], + ]; + + function testItRendersCorrectly() { + $output = Button::render($this->block, 200); + $expected_result = ' + + +
+ + + + +
Button +
+
+ + '; + expect($output)->equals($expected_result); + } +}