blob: 9f6d816439e1452f8a4cc5dc3de0f7534559b6a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<?php
/**
* Smarty PHPunit tests compiler errors
*
* @author Uwe Tews
*/
/**
* class for compiler tests
*
*
* @preserveGlobalState disabled
*
*/
class ExtendsIssue419Test extends PHPUnit_Smarty
{
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
public function testInit()
{
$this->cleanDirs();
}
public function testextends419()
{
$this->smarty->setLeftDelimiter('{{');
$this->smarty->setRightDelimiter('}}');
$this->assertEquals('child', $this->smarty->fetch('extends:001_parent.tpl|001_child.tpl'));
}
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);}}?>"}'));
}
}
|