From 323aefa89f32844ba35b9a10cda2a9d003998211 Mon Sep 17 00:00:00 2001 From: Thomas BACCELLI Date: Wed, 20 Oct 2021 16:00:21 +0200 Subject: [PATCH] Fix phpunit warning --- tests/UnitTests/SecurityTests/SecurityTest.php | 2 +- .../TagTests/TemplateFunction/CompileFunctionTest.php | 2 +- 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}'); }