public function TwigSandboxTest::testExtendedClass in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php \Drupal\Tests\Core\Template\TwigSandboxTest::testExtendedClass()
- 9 core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php \Drupal\Tests\Core\Template\TwigSandboxTest::testExtendedClass()
Tests that white listed classes can be extended.
File
- core/
tests/ Drupal/ Tests/ Core/ Template/ TwigSandboxTest.php, line 74 - Contains \Drupal\Tests\Core\Template\TwigSandboxTest.
Class
- TwigSandboxTest
- Tests the twig sandbox policy.
Namespace
Drupal\Tests\Core\TemplateCode
public function testExtendedClass() {
$this
->assertEquals(' class="kitten"', $this->twig
->render('{{ attribute.addClass("kitten") }}', [
'attribute' => new TestAttribute(),
]));
}