Skip to content

Commit b4837fc

Browse files
committed
tests: add test for check verify-magic-link route if allowMagicLinkLogins=false
1 parent 44ca768 commit b4837fc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/Controllers/MagicLinkTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,20 @@ public function testMagicLinkActionRedirectsIfNotAllowed(): void
152152
lang('Auth.magicLinkDisabled'),
153153
);
154154
}
155+
156+
public function testMagicLinkVerifyRedirectsIfNotAllowed(): void
157+
{
158+
$config = config('Auth');
159+
$config->allowMagicLinkLogins = false;
160+
Factories::injectMock('config', 'Auth', $config);
161+
162+
$result = $this->withSession()->get('/login/verify-magic-link');
163+
164+
$result->assertStatus(302);
165+
$result->assertRedirect();
166+
$result->assertSessionHas(
167+
'error',
168+
lang('Auth.magicLinkDisabled'),
169+
);
170+
}
155171
}

0 commit comments

Comments
 (0)