Skip to content

Commit 2437031

Browse files
gnutixSimperfit
authored andcommitted
Add a class_exists check.
1 parent 42e6c22 commit 2437031

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Test/WebTestCase.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
3434
use Symfony\Component\Security\Core\User\UserInterface;
3535

36-
// Compatibility layer for Symfony 4.3+
37-
class_alias('Symfony\Bundle\FrameworkBundle\KernelBrowser', 'Symfony\Bundle\FrameworkBundle\Client');
38-
3936
/**
4037
* @author Lea Haensenberger
4138
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
@@ -571,3 +568,8 @@ protected function tearDown(): void
571568
parent::tearDown();
572569
}
573570
}
571+
572+
// Compatibility layer for Symfony 4.3+
573+
if (class_exists('Symfony\Bundle\FrameworkBundle\KernelBrowser')) {
574+
class_alias('Symfony\Bundle\FrameworkBundle\KernelBrowser', 'Symfony\Bundle\FrameworkBundle\Client');
575+
}

0 commit comments

Comments
 (0)