File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/LiveComponent/src/Test Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 14
14
use Symfony \Bundle \FrameworkBundle \KernelBrowser ;
15
15
use Symfony \Component \HttpFoundation \Response ;
16
16
use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
17
+ use Symfony \Component \Security \Core \User \UserInterface ;
17
18
use Symfony \UX \LiveComponent \LiveComponentHydrator ;
18
19
use Symfony \UX \LiveComponent \Metadata \LiveComponentMetadataFactory ;
19
20
use Symfony \UX \TwigComponent \ComponentFactory ;
@@ -76,6 +77,16 @@ public function component(): object
76
77
return (new MountedComponent ($ this ->metadata ->getName (), $ component , $ componentAttributes ))->getComponent ();
77
78
}
78
79
80
+ /**
81
+ * @param UserInterface $user
82
+ */
83
+ public function actingAs (object $ user , string $ firewallContext = 'main ' ): self
84
+ {
85
+ $ this ->client ->loginUser ($ user , $ firewallContext );
86
+
87
+ return $ this ;
88
+ }
89
+
79
90
/**
80
91
* @param array<string,mixed> $arguments
81
92
*/
You can’t perform that action at this time.
0 commit comments