Files

43 lines
941 B
PHP
Raw Permalink Normal View History

<?php
/**
* Smarty PHPunit tests compiler errors
*
2023-08-08 00:04:14 +02:00
* @author Uwe Tews
*/
/**
* class for compiler tests
*
2023-08-08 00:04:14 +02:00
*
* @preserveGlobalState disabled
2023-08-08 00:04:14 +02:00
*
*/
class ExtendsIssue419Test extends PHPUnit_Smarty
{
2021-10-13 12:15:17 +02:00
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
public function testInit()
{
$this->cleanDirs();
}
public function testextends419()
{
2023-08-08 00:04:14 +02:00
$this->smarty->setLeftDelimiter('{{');
$this->smarty->setRightDelimiter('}}');
$this->assertEquals('child', $this->smarty->fetch('extends:001_parent.tpl|001_child.tpl'));
}
2024-05-28 22:44:30 +02:00
public function testextendsSecurity()
{
$this->expectException(\Smarty\Exception::class);
$this->expectExceptionMessageMatches('/Unable to load.*/');
$this->assertEquals('child', $this->smarty->fetch('string:{include "001_parent.tpl\', var_dump(shell_exec(\'ls\')), 1, 2, 3);}}?>"}'));
}
}