Skip to content

Commit 1ded15f

Browse files
committed
Fixing test for Symfony 5
1 parent cd918ce commit 1ded15f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/EventListener/ExceptionListenerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Symfony\WebpackEncoreBundle\Tests\EventListener;
1111

1212
use Symfony\Component\HttpFoundation\Request;
13+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
1314
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
1415
use Symfony\Component\HttpKernel\HttpKernelInterface;
1516
use PHPUnit\Framework\TestCase;
@@ -39,7 +40,8 @@ public function testItResetsAllEntrypointLookups()
3940

4041
$request = new Request();
4142
$exception = new \Exception();
42-
$event = new GetResponseForExceptionEvent(
43+
$exceptionClass = class_exists(ExceptionEvent::class) ? ExceptionEvent::class : GetResponseForExceptionEvent::class;
44+
$event = new $exceptionClass(
4345
$this->createMock(HttpKernelInterface::class),
4446
$request,
4547
HttpKernelInterface::MASTER_REQUEST,

0 commit comments

Comments
 (0)