File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,36 @@ public function testBackToLoginLinkOnPage(): void
120120 $ result = $ this ->get ('/login/magic-link ' );
121121 $ this ->assertStringContainsString (lang ('Auth.backToLogin ' ), $ result ->getBody ());
122122 }
123+
124+ public function testMagicLinkRedirectsIfNotAllowed (): void
125+ {
126+ $ config = config ('Auth ' );
127+ $ config ->allowMagicLinkLogins = false ;
128+ Factories::injectMock ('config ' , 'Auth ' , $ config );
129+
130+ $ result = $ this ->withSession ()->get ('/login/magic-link ' );
131+
132+ $ result ->assertStatus (302 );
133+ $ result ->assertRedirect ();
134+ $ result ->assertSessionHas (
135+ 'error ' ,
136+ lang ('Auth.magicLinkDisabled ' ),
137+ );
138+ }
139+
140+ public function testMagicLinkActionRedirectsIfNotAllowed (): void
141+ {
142+ $ config = config ('Auth ' );
143+ $ config ->allowMagicLinkLogins = false ;
144+ Factories::injectMock ('config ' , 'Auth ' , $ config );
145+
146+ $ result = $ this ->withSession ()->post ('/login/magic-link ' );
147+
148+ $ result ->assertStatus (302 );
149+ $ result ->assertRedirect ();
150+ $ result ->assertSessionHas (
151+ 'error ' ,
152+ lang ('Auth.magicLinkDisabled ' ),
153+ );
154+ }
123155}
You can’t perform that action at this time.
0 commit comments