This repository has been archived by the owner on Jun 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d2c979
commit 2423912
Showing
15 changed files
with
273 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
/phpunit.xml | ||
/var | ||
.phpunit.result.cache | ||
.ddev | ||
config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<phpunit | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
forceCoversAnnotation="false" | ||
processIsolation="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
strict="false" | ||
verbose="false" | ||
> | ||
<testsuites> | ||
<testsuite name="typo3_mjml tests"> | ||
<directory>../Functional/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
|
||
namespace Ssch\Typo3Mjml\Tests\Functional; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use Doctrine\DBAL\DBALException; | ||
use TYPO3\TestingFramework\Core\Exception; | ||
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; | ||
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
final class ConvertMjmlToHtmlTest extends FunctionalTestCase | ||
{ | ||
private const ROOT_PAGE_UID = 1; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $testExtensionsToLoad = [ | ||
'typo3conf/ext/typo3_mjml', | ||
]; | ||
|
||
/** | ||
* @var string[] | ||
*/ | ||
protected $coreExtensionsToLoad = ['fluid']; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $configurationToUseInTestInstance = [ | ||
'EXTENSIONS' => [ | ||
'typo3_mjml' => [ | ||
'type' => 'binary', | ||
'binary_path' => 'mjml' | ||
], | ||
], | ||
]; | ||
|
||
|
||
/** | ||
* @throws DBALException | ||
* @throws Exception | ||
*/ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->importDataSet(__DIR__ . '/Fixtures/Database/pages.xml'); | ||
$this->setUpFrontendRootPage(1, ['EXT:typo3_mjml/Tests/Functional/Fixtures/Frontend/Basic.typoscript']); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function convertToHtml(): void | ||
{ | ||
$result = $this->retrieveFrontendRequestResult( | ||
(new InternalRequest())->withPageId(self::ROOT_PAGE_UID), | ||
(new InternalRequestContext()), | ||
false | ||
); | ||
$response = $this->reconstituteFrontendRequestResult($result); | ||
|
||
$this->assertStringContainsString($response->getBody()->getContents(),file_get_contents( __DIR__ . '/Fixtures/converted.html')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dataset> | ||
<pages> | ||
<uid>1</uid> | ||
<pid>0</pid> | ||
<title>Root</title> | ||
<deleted>0</deleted> | ||
<perms_everybody>15</perms_everybody> | ||
</pages> | ||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
config { | ||
no_cache = 1 | ||
debug = 0 | ||
xhtml_cleaning = 0 | ||
admPanel = 0 | ||
disableAllHeaderCode = 1 | ||
sendCacheHeaders = 0 | ||
sys_language_uid = 0 | ||
sys_language_mode = ignore | ||
sys_language_overlay = 1 | ||
absRefPrefix = / | ||
linkVars = L | ||
contentObjectExceptionHandler = 0 | ||
|
||
spamProtectEmailAddresses = 2 | ||
spamProtectEmailAddresses_atSubst = (AT) | ||
spamProtectEmailAddresses_lastDotSubst = (DOT) | ||
|
||
intTarget = _blank | ||
} | ||
|
||
page = PAGE | ||
page { | ||
10 = FLUIDTEMPLATE | ||
10 { | ||
templateName = Default | ||
templateRootPaths { | ||
20 = EXT:typo3_mjml/Tests/Functional/Fixtures/Frontend/ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:m="http://typo3.org/ns/Ssch/Typo3Mjml/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<m:mjmlToHtml> | ||
<mjml> | ||
<mj-body background-color="#F4F4F4" color="#55575d" font-family="Arial, sans-serif"> | ||
<mj-section background-color="#000000" background-repeat="no-repeat" text-align="center" vertical-align="top"> | ||
<mj-column> | ||
<mj-image align="center" border="none" padding-bottom="30px" padding="10px 25px" src="http://5vph.mj.am/img/5vph/b/1g86w/0g67t.png" target="_blank" title="" width="180px"></mj-image> | ||
<mj-text align="left" color="#55575d" font-family="Arial, sans-serif" font-size="13px" line-height="22px" padding-bottom="0px" padding-top="0px" padding="10px 25px"> | ||
<p style="line-height: 18px; margin: 10px 0; text-align: center;font-size:14px;color:#ffffff;font-family:'Times New Roman',Helvetica,Arial,sans-serif">WOMEN | MEN | KIDS</p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#000000" background-repeat="no-repeat" text-align="center" vertical-align="top" padding="0 0 0 0"> | ||
<mj-column> | ||
<mj-image align="center" border="none" padding-bottom="0px" padding-left="0px" padding-right="0px" padding="0px 25px" src="http://5vph.mj.am/img/5vph/b/1g86w/0696u.jpeg" target="_blank" title="" width="780px"></mj-image> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#000000" background-repeat="no-repeat" text-align="center" vertical-align="top" padding="0 0 0 0"> | ||
<mj-column> | ||
<mj-text align="left" color="#55575d" font-family="Arial, sans-serif" font-size="13px" line-height="22px" padding-bottom="5px" padding-top="25px" padding="10px 25px"> | ||
<p style="line-height: 60px; text-align: center; margin: 10px 0;font-size:55px;color:#fcfcfc;font-family:'Times New Roman',Helvetica,Arial,sans-serif"> | ||
<b>Black Friday</b> | ||
</p> | ||
</mj-text> | ||
<mj-text align="left" color="#55575d" font-family="Arial, sans-serif" font-size="13px" line-height="22px" padding-bottom="20px" padding-top="0px" padding="10px 25px"> | ||
<p style="line-height: 30px; text-align: center; margin: 10px 0;color:#f5f5f5;font-size:25px;font-family:'Times New Roman',Helvetica,Arial,sans-serif"><b>Take an extra 50% off</b><br/><span style="color:#ffffff;font-size:18px;font-family:'Times New Roman',Helvetica,Arial,sans-serif">Use code SALEONSALE* at checkout</span></p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#000000" background-repeat="no-repeat" text-align="center" vertical-align="top" padding-bottom="40px" padding="0 0 0 0"> | ||
<mj-column> | ||
<mj-button background-color="#ffffff" border-radius="3px" font-family="Times New Roman, Helvetica, Arial, sans-serif" font-size="18px" font-weight="normal" inner-padding="10px 25px" padding-bottom="30px" padding="10px 25px"><span style="color:#212020">Shop Now</span></mj-button> | ||
<mj-text align="left" color="#55575d" font-family="Arial, sans-serif" font-size="13px" line-height="22px" padding-bottom="0px" padding-top="5px" padding="10px 25px"> | ||
<p style="line-height: 16px; text-align: center; margin: 10px 0;font-size:12px;color:#ffffff;font-family:'Times New Roman',Helvetica,Arial,sans-serif">* Offer valid on Allura purchases on 17/29/11 at 11:59 pm. No price adjustments on previous <br/><span style="color:#ffffff;font-family:'Times New Roman',Helvetica,Arial,sans-serif">purchases, offer limited to stock. Cannot be combined with any offer or promotion other than free.</span></p> | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> | ||
</m:mjmlToHtml> | ||
</html> |
Oops, something went wrong.