Skip to content

Commit 5ffe41a

Browse files
committed
[TASK] Add further test to make sure view helper is rendered
1 parent 7e1da76 commit 5ffe41a

5 files changed

Lines changed: 28 additions & 4 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ before_install:
2323
- phpenv config-rm xdebug.ini
2424

2525
install:
26-
- composer require typo3/cms=$TYPO3_VERSION
26+
- composer require typo3/minimal=$TYPO3_VERSION
2727
- export TYPO3_PATH_WEB="$PWD/.Build/Web"
2828

2929
script:

Tests/Functional/Fixtures/Frontend/Basic.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ lib.link {
3030
lib.fluid = FLUIDTEMPLATE
3131
lib.fluid.file = EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Template.html
3232

33+
lib.viewHelper = FLUIDTEMPLATE
34+
lib.viewHelper.file = EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/ViewHelperTemplate.html
35+
tt_content.typoscriptrendering_plugintest.20 = TEXT
36+
3337
page = PAGE
3438
page {
3539
10 = TEXT
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
<f:link.email email="info@helhum.io" />
1+
<html xmlns="http://www.w3.org/1999/xhtml"
2+
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
3+
data-namespace-typo3-fluid="true">
4+
<f:link.email email="info@helhum.io" />
5+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml"
2+
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
3+
xmlns:t="http://typo3.org/ns/Helhum/TyposcriptRendering/ViewHelpers"
4+
data-namespace-typo3-fluid="true">
5+
<t:uri.ajaxAction controller="Foo" pluginName="pluginTest" extensionName="TyposcriptRendering" contextRecord="currentPage"/>
6+
</html>

Tests/Functional/RenderingTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function urlGeneratedRespectAbsRefPrefixAndLinkVarsAndTarget()
2222
{
2323
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.link')];
2424
$expectedContent = '<a href="/index.php?id=1&amp;L=1" target="_blank">link</a>';
25-
$this->assertSame($expectedContent, $this->fetchFrontendResponse($requestArguments)->getContent());
25+
$this->assertSame($expectedContent, trim($this->fetchFrontendResponse($requestArguments)->getContent()));
2626
}
2727

2828
/**
@@ -32,6 +32,16 @@ public function emailViewHelperWorksAlsoWithSpamProtection()
3232
{
3333
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.fluid')];
3434
$expectedContent = '<a href="javascript:linkTo_UnCryptMailto(\'ocknvq,kphqBjgnjwo0kq\');">info(AT)helhum(DOT)io</a>';
35-
$this->assertSame($expectedContent, $this->fetchFrontendResponse($requestArguments)->getContent());
35+
$this->assertSame($expectedContent, trim($this->fetchFrontendResponse($requestArguments)->getContent()));
36+
}
37+
38+
/**
39+
* @test
40+
*/
41+
public function viewHelperOutputsUri()
42+
{
43+
$requestArguments = ['url' => $this->getRenderUrl(1, 1, 'lib.viewHelper')];
44+
$expectedContent = '/index.php?id=1&amp;L=1&amp;tx_typoscriptrendering%5Bcontext%5D=%7B%22record%22%3A%22pages_1%22%2C%22path%22%3A%22tt_content.typoscriptrendering_plugintest.20%22%7D&amp;tx_typoscriptrendering_plugintest%5Bcontroller%5D=Foo&amp;cHash=';
45+
$this->assertSame(0, strpos(trim($this->fetchFrontendResponse($requestArguments)->getContent()), $expectedContent));
3646
}
3747
}

0 commit comments

Comments
 (0)