Skip to content

Commit

Permalink
Fixed PHPUnit expected Exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Jan 10, 2022
1 parent 6f4f06d commit b717563
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php
Expand Up @@ -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));
Expand Down

0 comments on commit b717563

Please sign in to comment.