Files
smarty/tests/UnitTests/SecurityTests/FunctionTest.php
2023-01-07 23:45:59 +01:00

39 lines
679 B
PHP

<?php
/**
* Smarty PHPunit tests of function calls
*
* @author Uwe Tews
*/
/**
* class for function tests
*
*
*
*
*/
class FunctionTest extends PHPUnit_Smarty
{
public function setUp(): void
{
$this->setUpSmarty(__DIR__);
}
public function testInit()
{
$this->cleanDirs();
}
/**
* test unknown function error
*/
public function testUnknownFunction()
{
$this->smarty->enableSecurity();
$this->expectException(\Smarty\CompilerException::class);
$this->expectExceptionMessage('Cannot compile unknown function unknown');
$this->smarty->fetch('eval:{unknown()}');
}
}