Simplify code

This commit is contained in:
Fabien Potencier
2023-12-09 17:18:14 +01:00
parent aa4b59c0ed
commit a64561b420
+2 -2
View File
@@ -11,6 +11,7 @@
namespace Twig\Test;
use PHPUnit\Framework\Constraint\Exception;
use PHPUnit\Framework\TestCase;
use Twig\Environment;
use Twig\Error\Error;
@@ -235,8 +236,7 @@ abstract class IntegrationTestCase extends TestCase
if (false !== $exception) {
[$class] = explode(':', $exception);
$constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception';
$this->assertThat(null, new $constraintClass($class));
$this->assertThat(null, new Exception($class));
}
$expected = trim($match[3], "\n ");