‪TYPO3CMS  10.4
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 {
29  protected ‪$initializeDatabase = false;
30 
31  public static function ‪isSanitizedDataProvider(): array
32  {
33  // @todo splitter for functional tests cannot deal with external classes
35  }
36 
43  public function ‪isSanitizedUsingNodeInstruction(string $payload, string $expectation): void
44  {
45  $view = new ‪StandaloneView();
46  $view->setTemplateSource(sprintf('<f:sanitize.html>%s</f:sanitize.html>', $payload));
47  self::assertSame($expectation, $view->render());
48  }
49 
56  public function ‪isSanitizedUsingInlineInstruction(string $payload, string $expectation): void
57  {
58  $view = new ‪StandaloneView();
59  $view->assign('payload', $payload);
60  $view->setTemplateSource('{payload -> f:sanitize.html()}');
61  self::assertSame($expectation, $view->render());
62  }
63 }
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\isSanitizedDataProvider
‪static isSanitizedDataProvider()
Definition: HtmlViewHelperTest.php:30
‪TYPO3\CMS\Core\Tests\Functional\Html\DefaultSanitizerBuilderTest\isSanitizedDataProvider
‪static isSanitizedDataProvider()
Definition: DefaultSanitizerBuilderTest.php:34
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\isSanitizedUsingNodeInstruction
‪isSanitizedUsingNodeInstruction(string $payload, string $expectation)
Definition: HtmlViewHelperTest.php:42
‪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:55
‪TYPO3\CMS\Core\Tests\Functional\Html\DefaultSanitizerBuilderTest
Definition: DefaultSanitizerBuilderTest.php:29
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize\HtmlViewHelperTest\$initializeDatabase
‪bool $initializeDatabase
Definition: HtmlViewHelperTest.php:28
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers\Sanitize
Definition: HtmlViewHelperTest.php:18