File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 33namespace Zenstruck \Browser \Tests ;
44
55use Symfony \Bundle \FrameworkBundle \KernelBrowser as SymfonyKernelBrowser ;
6+ use Symfony \Component \Security \Core \User \InMemoryUser ;
67use Symfony \Component \Security \Core \User \User ;
78use 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 ;
You can’t perform that action at this time.
0 commit comments