Improve exception expectations reliability

This commit is contained in:
Alexandre Daubois
2024-09-04 15:20:36 +02:00
parent fb2663eb69
commit 797e490356
13 changed files with 128 additions and 111 deletions
+3 -6
View File
@@ -19,10 +19,9 @@ class ArrayTest extends TestCase
{
public function testGetSourceContextWhenTemplateDoesNotExist()
{
$this->expectException(LoaderError::class);
$loader = new ArrayLoader();
$this->expectException(LoaderError::class);
$loader->getSourceContext('foo');
}
@@ -57,10 +56,9 @@ class ArrayTest extends TestCase
public function testGetCacheKeyWhenTemplateDoesNotExist()
{
$this->expectException(LoaderError::class);
$loader = new ArrayLoader();
$this->expectException(LoaderError::class);
$loader->getCacheKey('foo');
}
@@ -80,10 +78,9 @@ class ArrayTest extends TestCase
public function testIsFreshWhenTemplateDoesNotExist()
{
$this->expectException(LoaderError::class);
$loader = new ArrayLoader();
$this->expectException(LoaderError::class);
$loader->isFresh('foo', time());
}
}