mjml-typo3/Tests/Functional/RendersMjmlTemplateTest.php
Daniel Siepmann c45dee45b0
[TASK] Update MJML and clean up parts of the extension for new release (#31)
Use one functional test to ensure everything works,
no unit tests with heavy mocking.

Update mjml to fix security issues and allow new options.

Provide GitHub Actions. This is a public extension with free minutes
which should ensure that existing setup still works.
2022-09-15 15:58:08 +02:00

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);
}
}