function TwigSandboxTest::testExtendedClass
Tests that white listed classes can be extended.
File
-
core/
tests/ Drupal/ Tests/ Core/ Template/ TwigSandboxTest.php, line 74
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(),
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.