Skip to content

Commit a4bd32a

Browse files
committed
[minor] fix symfony 5.3 deprecation
1 parent 22da239 commit a4bd32a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/KernelBrowserTests.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Zenstruck\Browser\Tests;
44

55
use Symfony\Bundle\FrameworkBundle\KernelBrowser as SymfonyKernelBrowser;
6+
use Symfony\Component\Security\Core\User\InMemoryUser;
67
use Symfony\Component\Security\Core\User\User;
78
use Zenstruck\Browser\KernelBrowser;
89

@@ -35,9 +36,11 @@ public function can_act_as_user(): void
3536
$this->markTestSkipped(SymfonyKernelBrowser::class.'::loginUser() is only available in Symfony 5.1+.');
3637
}
3738

39+
$userClass = \class_exists(InMemoryUser::class) ? InMemoryUser::class : User::class;
40+
3841
$this->browser()
3942
->throwExceptions()
40-
->actingAs(new User('kevin', 'pass'))
43+
->actingAs(new $userClass('kevin', 'pass'))
4144
->visit('/user')
4245
->assertSee('user: kevin/pass')
4346
;

0 commit comments

Comments
 (0)