runTwig example

/** * @internal * * @covers \Shopware\Core\Framework\Adapter\Twig\SecurityExtension */
class SecurityExtensionTest extends TestCase
{
    public function testMapNotAllowedFunction(): void
    {
        $this->expectException(RuntimeError::class);
        $this->runTwig('{{ ["a", "b", "c"]|map("str_rot13")|join }}');
    }

    public function testMapNotAllowedCallbackFunctionString(): void
    {
        $this->expectException(RuntimeError::class);
        $this->runTwig('{{ ["a", "b", "c"]|map("\\\\Shopware\\\\Tests\\\\Unit\\\\Core\\\\Framework\\\\Adapter\\\\Twig\\\\SecurityExtensionGadget::do")|join }}');
    }

    public function testMapNotAllowedCallbackFunctionArray(): void
    {
        $this->expectException(RuntimeError::class);
        
Home | Imprint | This part of the site doesn't use cookies.