File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3123,6 +3123,20 @@ uses Symfony's test client to render and make requests to your components::
3123
3123
$response = $testComponent->call('redirect')->response(); // Symfony\Component\HttpFoundation\Response
3124
3124
3125
3125
$this->assertSame(302, $response->getStatusCode());
3126
+
3127
+ // authenticate a user ($user is instance of UserInterface)
3128
+ $testComponent->actingAs($user);
3129
+
3130
+ // customize the test client
3131
+ $client = self::getContainer()->get('test.client');
3132
+
3133
+ // do some stuff with the client (ie login user via form)
3134
+
3135
+ $testComponent = $this->createLiveComponent(
3136
+ name: 'MyComponent',
3137
+ data: ['foo' => 'bar'],
3138
+ client: $client,
3139
+ );
3126
3140
}
3127
3141
}
3128
3142
You can’t perform that action at this time.
0 commit comments