mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-11-21 23:56:09 +01:00
[TASK] Update mjml 4.5.1 & ext to 1.0.3
This commit is contained in:
parent
3025201ecd
commit
64132083fa
6 changed files with 659 additions and 2662 deletions
|
@ -16,27 +16,6 @@ class CommandTest extends AbstractUnitTestCase
|
||||||
*/
|
*/
|
||||||
protected $objectManager;
|
protected $objectManager;
|
||||||
|
|
||||||
public const EXAMPLE_MJML_TEMPLATE = '<mjml>
|
|
||||||
<mj-body>
|
|
||||||
<mj-section>
|
|
||||||
<mj-column>
|
|
||||||
<mj-image src="/assets/img/easy-and-quick.png" width="112px" />
|
|
||||||
<mj-text font-size="20px" color="#595959" align="center">Easy and Quick</mj-text>
|
|
||||||
</mj-column>
|
|
||||||
<mj-column>
|
|
||||||
<mj-image src="/assets/img/responsive.png" width="135px" />
|
|
||||||
<mj-text font-size="20px" color="#595959" align="center">Responsive</mj-text>
|
|
||||||
</mj-column>
|
|
||||||
</mj-section>
|
|
||||||
<mj-section>
|
|
||||||
<mj-column>
|
|
||||||
<mj-button background-color="#F45E43" font-size="15px">Discover</mj-button>
|
|
||||||
</mj-column>
|
|
||||||
</mj-section>
|
|
||||||
</mj-body>
|
|
||||||
</mjml>
|
|
||||||
';
|
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -54,7 +33,7 @@ class CommandTest extends AbstractUnitTestCase
|
||||||
->getMock();
|
->getMock();
|
||||||
$packageMock->expects($this->any())
|
$packageMock->expects($this->any())
|
||||||
->method('getPackagePath')
|
->method('getPackagePath')
|
||||||
->willReturn(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/');
|
->willReturn(dirname(__FILE__, 5) . '/');
|
||||||
$packageManagerMock = $this->getMockBuilder(PackageManager::class)->getMock();
|
$packageManagerMock = $this->getMockBuilder(PackageManager::class)->getMock();
|
||||||
$packageManagerMock->expects($this->any())
|
$packageManagerMock->expects($this->any())
|
||||||
->method('isPackageActive')
|
->method('isPackageActive')
|
||||||
|
@ -74,13 +53,14 @@ class CommandTest extends AbstractUnitTestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$subject = $this->objectManager->get(Command::class);
|
$subject = $this->objectManager->get(Command::class);
|
||||||
$html = $subject->getHtmlFromMjml(static::EXAMPLE_MJML_TEMPLATE);
|
$mjml = file_get_contents(__DIR__ . '/CommandTestFixture/Basic.mjml');
|
||||||
|
$html = $subject->getHtmlFromMjml($mjml);
|
||||||
|
|
||||||
// remove comment rendered by the outputToConsole https://github.com/mjmlio/mjml/blob/50b08513b7a651c234829abfde254f106a62c859/packages/mjml-cli/src/commands/outputToConsole.js#L4
|
// remove comment rendered by the outputToConsole https://github.com/mjmlio/mjml/blob/50b08513b7a651c234829abfde254f106a62c859/packages/mjml-cli/src/commands/outputToConsole.js#L4
|
||||||
$html = preg_replace('/<!-- FILE: (.*)-->/Uis', '', $html);
|
$html = preg_replace('/<!-- FILE: (.*)-->/Uis', '', $html);
|
||||||
|
|
||||||
$this->assertStringEqualsFile(
|
$this->assertStringEqualsFile(
|
||||||
dirname(__FILE__) . '/CommandTestFixture/Expected.html',
|
__DIR__ . '/CommandTestFixture/Expected.html',
|
||||||
$html,
|
$html,
|
||||||
'Command renderer did not return expected HTML.'
|
'Command renderer did not return expected HTML.'
|
||||||
);
|
);
|
||||||
|
|
19
Tests/Unit/Domain/Renderer/CommandTestFixture/Basic.mjml
Normal file
19
Tests/Unit/Domain/Renderer/CommandTestFixture/Basic.mjml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<mjml>
|
||||||
|
<mj-body>
|
||||||
|
<mj-section>
|
||||||
|
<mj-column>
|
||||||
|
<mj-image src="/assets/img/easy-and-quick.png" width="112px" />
|
||||||
|
<mj-text font-size="20px" color="#595959" align="center">Easy and Quick</mj-text>
|
||||||
|
</mj-column>
|
||||||
|
<mj-column>
|
||||||
|
<mj-image src="/assets/img/responsive.png" width="135px" />
|
||||||
|
<mj-text font-size="20px" color="#595959" align="center">Responsive</mj-text>
|
||||||
|
</mj-column>
|
||||||
|
</mj-section>
|
||||||
|
<mj-section>
|
||||||
|
<mj-column>
|
||||||
|
<mj-button background-color="#F45E43" font-size="15px">Discover</mj-button>
|
||||||
|
</mj-column>
|
||||||
|
</mj-section>
|
||||||
|
</mj-body>
|
||||||
|
</mjml>
|
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@ $EM_CONF[$_EXTKEY] = [
|
||||||
'description' => 'Mjml view using mjml over npm',
|
'description' => 'Mjml view using mjml over npm',
|
||||||
'category' => 'misc',
|
'category' => 'misc',
|
||||||
'shy' => 0,
|
'shy' => 0,
|
||||||
'version' => '1.0.2',
|
'version' => '1.0.3',
|
||||||
'state' => 'stable',
|
'state' => 'stable',
|
||||||
'clearCacheOnLoad' => 1,
|
'clearCacheOnLoad' => 1,
|
||||||
'author' => '',
|
'author' => '',
|
||||||
|
|
3074
package-lock.json
generated
3074
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mjml-typo3",
|
"name": "mjml-typo3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mjml": "^4.3.1"
|
"mjml": "^4.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue