mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-11-15 08:36:09 +01:00
40 lines
1,011 B
PHP
40 lines
1,011 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Saccas\Mjml\Tests\Functional;
|
||
|
|
||
|
use Saccas\Mjml\View\MjmlBasedView;
|
||
|
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
|
||
|
|
||
|
class RendersMjmlTemplateTest extends FunctionalTestCase
|
||
|
{
|
||
|
protected $testExtensionsToLoad = [
|
||
|
'typo3conf/ext/mjml',
|
||
|
];
|
||
|
|
||
|
protected $configurationToUseInTestInstance = [
|
||
|
'EXTENSIONS' => [
|
||
|
'mjml' => [
|
||
|
'nodeBinaryPath' => 'node',
|
||
|
'mjmlBinaryPath' => './node_modules/mjml/bin/',
|
||
|
'mjmlBinary' => 'mjml',
|
||
|
'mjmlParams' => '-s --noStdoutFileComment',
|
||
|
],
|
||
|
],
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* @test
|
||
|
*/
|
||
|
public function returnsHtmlResult(): void
|
||
|
{
|
||
|
$subject = $this->get(MjmlBasedView::class);
|
||
|
$subject->setTemplateSource(file_get_contents(__DIR__ . '/Fixtures/Input.mjml'));
|
||
|
|
||
|
$result = $subject->render();
|
||
|
|
||
|
self::assertStringEqualsFile(__DIR__ . '/Fixtures/Expected.html', $result);
|
||
|
}
|
||
|
}
|