Easy and Quick
Responsive
Discover
';
/**
* @test
*/
public function viewCallsRendererAndReturnsRenderedHtml(): void
{
$expectedHtml = 'Simple HTML
';
$rendererMock = $this->getMockBuilder(RendererInterface::class)->getMock();
$rendererMock->expects($this->once())
->method('getHtmlFromMjml')
->with(static::EXAMPLE_MJML_TEMPLATE)
->willReturn($expectedHtml);
$subject = new MjmlBasedView(null, $rendererMock);
$subject->setTemplateSource(static::EXAMPLE_MJML_TEMPLATE);
$result = $subject->render();
$this->assertSame(
$expectedHtml,
$result,
'Rendering of view did not return expected HTML.'
);
}
}