-
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.
Merge pull request #22 from b13/bugfix/svg
[BUGFIX] SVG Rendering
- Loading branch information
Showing
5 changed files
with
81 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"pages" | ||
,"uid","pid","title","slug" | ||
,1,0,"root","/" | ||
"sys_template" | ||
,"uid","pid","root","config" | ||
,1,1,1,"page = PAGE | ||
page.10 = FLUIDTEMPLATE | ||
page.10.templateRootPaths.10 = EXT:assetcollector/Tests/Functional/Frontend/Fixtures/Templates | ||
page.10.templateName = SvgViewHelper.html | ||
plugin.tx_assetcollector.icons.download = EXT:assetcollector/Resources/Public/Icons/Extension.svg | ||
" |
9 changes: 9 additions & 0 deletions
9
Tests/Functional/Frontend/Fixtures/Templates/SvgViewHelper.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,9 @@ | ||
<html | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:ac="http://typo3.org/ns/B13/Assetcollector/ViewHelpers" | ||
data-namespace-typo3-fluid="true" | ||
> | ||
<f:spaceless> | ||
<ac:svg name="download" /> | ||
</f:spaceless> | ||
</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,37 @@ | ||
<?php | ||
|
||
namespace B13\Assetcollector\Tests\Functional\Functional; | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "assetcollector" by b13. | ||
* | ||
* 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. | ||
*/ | ||
|
||
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
class SvgViewHelperTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = ['typo3conf/ext/assetcollector']; | ||
protected array $coreExtensionsToLoad = ['core', 'frontend']; | ||
protected array $pathsToLinkInTestInstance = ['typo3conf/ext/assetcollector/Build/sites' => 'typo3conf/sites']; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function scriptTagForInlineCssIsRendered(): void | ||
{ | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/SvgViewHelper.csv'); | ||
$response = $this->executeFrontendSubRequest(new InternalRequest('http://localhost/')); | ||
$expected = '<svg><use xlink:href="#icon-Extension"></use></svg>'; | ||
$body = (string)$response->getBody(); | ||
self::assertStringContainsString($expected, $body); | ||
$expected = '<svg class="tx_assetcollector"'; | ||
self::assertStringContainsString($expected, $body); | ||
$expected = '<rect y="0.3" class="st0" width="256" height="256"></rect>'; | ||
self::assertStringContainsString($expected, $body); | ||
} | ||
} |