summaryrefslogtreecommitdiff
path: root/tests/UnitTests
diff options
context:
space:
mode:
authorThomas BACCELLI <tbaccelli@gmail.com>2021-10-20 16:00:21 +0200
committerThomas A. Hirsch <thomas.hirsch@vema-eg.de>2022-01-18 15:56:23 +0100
commit323aefa89f32844ba35b9a10cda2a9d003998211 (patch)
tree747b638563e103fa5764aa9e8818b2b9346f5f2a /tests/UnitTests
parent277648b81cb49cfd1449bc876f874c2421e97af2 (diff)
downloadsmarty-323aefa89f32844ba35b9a10cda2a9d003998211.tar.gz
smarty-323aefa89f32844ba35b9a10cda2a9d003998211.tar.bz2
smarty-323aefa89f32844ba35b9a10cda2a9d003998211.zip
Fix phpunit warning
Diffstat (limited to 'tests/UnitTests')
-rw-r--r--tests/UnitTests/SecurityTests/SecurityTest.php2
-rw-r--r--tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/UnitTests/SecurityTests/SecurityTest.php b/tests/UnitTests/SecurityTests/SecurityTest.php
index dfaffa67..d68ac3d4 100644
--- a/tests/UnitTests/SecurityTests/SecurityTest.php
+++ b/tests/UnitTests/SecurityTests/SecurityTest.php
@@ -366,9 +366,9 @@ class SecurityTest extends PHPUnit_Smarty
/**
* In security mode, accessing $smarty.template_object should be illegal.
- * @expectedException SmartyCompilerException
*/
public function testSmartyTemplateObject() {
+ $this->expectException(SmartyCompilerException::class);
$this->smarty->display('string:{$smarty.template_object}');
}
diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php
index ca3e3714..61a08583 100644
--- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php
+++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php
@@ -435,9 +435,9 @@ class CompileFunctionTest extends PHPUnit_Smarty
/**
* Test handling of function names that are a security risk
- * @expectedException SmartyCompilerException
*/
public function testIllegalFunctionName() {
+ $this->expectException(SmartyCompilerException::class);
$this->smarty->fetch('string:{function name=\'rce(){};echo "hi";function \'}{/function}');
}