From b717563d1eb0175aa5431573b12f18663d74bbdd Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 10 Jan 2022 09:35:43 +0100 Subject: [PATCH] Fixed PHPUnit expected Exceptions. --- .../TemplateSource/ValueTests/Math/MathTest.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php index 7506f1670..299a6852b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php @@ -108,31 +108,25 @@ public function testFunctionString() $this->assertEquals($expected, $this->smarty->fetch($tpl)); } - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ public function testBackticksIllegal() { + $this->expectException(PHPUnit\Framework\Error\Warning::class); $expected = "22.00"; $tpl = $this->smarty->createTemplate('eval:{$x = "4"}{$y = "5.5"}{math equation="`ls` x * y" x=$x y=$y}'); $this->assertEquals($expected, $this->smarty->fetch($tpl)); } - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ public function testDollarSignsIllegal() { + $this->expectException(PHPUnit\Framework\Error\Warning::class); $expected = "22.00"; $tpl = $this->smarty->createTemplate('eval:{$x = "4"}{$y = "5.5"}{math equation="$" x=$x y=$y}'); $this->assertEquals($expected, $this->smarty->fetch($tpl)); } - /** - * @expectedException PHPUnit_Framework_Error_Warning - */ public function testBracketsIllegal() { + $this->expectException(PHPUnit\Framework\Error\Warning::class); $expected = "I"; $tpl = $this->smarty->createTemplate('eval:{$x = "0"}{$y = "1"}{math equation="((y/x).(x))[x]" x=$x y=$y}'); $this->assertEquals($expected, $this->smarty->fetch($tpl));