File tree Expand file tree Collapse file tree
tests/FunctionalTests/Controller/Dashboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ security:
2525 lazy : true
2626 provider : database_users
2727 form_login :
28- login_path : /?routeName= dashboard_login
28+ login_path : dashboard_login
2929 check_path : dashboard_login
3030 remember_me :
3131 secret : ' %kernel.secret%'
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace CodedMonkey \Dirigent \Tests \FunctionalTests \Controller \Dashboard ;
4+
5+ use CodedMonkey \Dirigent \Tests \Helper \WebTestCaseTrait ;
6+ use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
7+ use Symfony \Component \HttpFoundation \Response ;
8+
9+ class DashboardSecurityControllerTest extends WebTestCase
10+ {
11+ use WebTestCaseTrait;
12+
13+ /**
14+ * Verify the homepage redirects to the login page when the application is not publicly accessible.
15+ */
16+ public function testLoginRedirect (): void
17+ {
18+ $ client = static ::createClient ();
19+ $ client ->request ('GET ' , '/ ' );
20+
21+ $ this ->assertResponseStatusCodeSame (Response::HTTP_FOUND );
22+
23+ $ client ->followRedirect ();
24+
25+ self ::assertSame ('/login ' , $ client ->getRequest ()->getRequestUri ());
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments