mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-07-06 10:38:28 +02:00
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.
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);
|
|
}
|
|
}
|