‪TYPO3CMS  9.5
HtmlViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
23 
24 class ‪HtmlViewHelperTest extends FunctionalTestCase
25 {
26  public static function ‪isSanitizedDataProvider(): array
27  {
28  // @todo splitter for functional tests cannot deal with external classes
30  }
31 
38  public function ‪isSanitizedUsingNodeInstruction(string $payload, string $expectation): void
39  {
40  $view = new ‪StandaloneView();
41  $view->setTemplateSource(sprintf('<f:sanitize.html>%s</f:sanitize.html>', $payload));
42  self::assertSame($expectation, $view->render());
43  }
44 
51  public function ‪isSanitizedUsingInlineInstruction(string $payload, string $expectation): void
52  {
53  $view = new ‪StandaloneView();
54  $view->assign('payload', $payload);
55  $view->setTemplateSource('{payload -> f:sanitize.html()}');
56  self::assertSame($expectation, $view->render());
57  }
58 }
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\isSanitizedDataProvider
‪static isSanitizedDataProvider()
Definition: HtmlViewHelperTest.php:26
‪TYPO3\CMS\Core\Tests\Functional\Html\DefaultSanitizerBuilderTest\isSanitizedDataProvider
‪static isSanitizedDataProvider()
Definition: DefaultSanitizerBuilderTest.php:29
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\isSanitizedUsingNodeInstruction
‪isSanitizedUsingNodeInstruction(string $payload, string $expectation)
Definition: HtmlViewHelperTest.php:38
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest
Definition: HtmlViewHelperTest.php:25
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\isSanitizedUsingInlineInstruction
‪isSanitizedUsingInlineInstruction(string $payload, string $expectation)
Definition: HtmlViewHelperTest.php:51
‪TYPO3\CMS\Core\Tests\Functional\Html\DefaultSanitizerBuilderTest
Definition: DefaultSanitizerBuilderTest.php:24
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:32
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize
Definition: HtmlViewHelperTest.php:18