This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ github : codedge
Original file line number Diff line number Diff line change 2525 <env name =" APP_DEBUG" value =" true" />
2626 <env name =" APP_KEY" value =" base64:mIRM5Fpb6DtuRIejBwkqpt3c/ovlFZsSpo66efwo3g0=" />
2727 <env name =" CACHE_DRIVER" value =" array" />
28+ <env name =" SESSION_DRIVER" value =" array" />
29+ <env name =" QUEUE_DRIVER" value =" sync" />
2830 <env name =" MAIL_DRIVER" value =" array" />
2931 </php >
3032</phpunit >
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ public function register()
6868 $ this ->app ->bind (SettingsRepository::class, function () {
6969 return new SettingsRepository (new Filesystem ());
7070 });
71+
72+ $ this ->app ->bind (MagicLinkManager::class, function () {
73+ return new MagicLinkManager (new Filesystem ());
74+ });
7175 }
7276
7377 private function bootNavigation (): void
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Codedge \MagicLink \Tests ;
4+
5+ class LoginTest extends TestCase
6+ {
7+ /** @test */
8+ public function can_see_magic_link_link (): void
9+ {
10+ $ this ->get (cp_route ('login ' ))
11+ ->assertSee ('Send Magic Link ' )
12+ ->assertOk ();
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Codedge \MagicLink \Tests \MagicLink ;
4+
5+ use Codedge \MagicLink \Tests \TestCase ;
6+
7+ class MagicLinkFormTest extends TestCase
8+ {
9+ /** @test */
10+ public function can_show_magic_link_form (): void
11+ {
12+ $ this ->get (route ('magiclink.show-send-link-form ' ))
13+ ->assertOk ()
14+ ->assertSee (__ ('magiclink::web.back_to_classic_login ' ));
15+ }
16+
17+ /** @test */
18+ public function cannot_get_link_for_invalid_address (): void
19+ {
20+ $ payload = [
21+ 'email ' => 'wrong-email-format '
22+ ];
23+
24+ $ this ->post (route ('magiclink.send-link ' ), $ payload )
25+ ->assertSessionHasErrors (['email ' ]);
26+
27+ $ payload = [
28+ 'email ' => ''
29+ ];
30+
31+ $ this ->post (route ('magiclink.send-link ' ), $ payload )
32+ ->assertSessionHasErrors (['email ' ]);
33+ }
34+
35+ // /** @test */
36+ // public function can_request_link_for_non_existing_user(): void
37+ // {
38+ // $payload = [
39+ // 'email' => 'john@doe.com'
40+ // ];
41+ //
42+ // $this->post(route('magiclink.send-link'), $payload)->assertOk();
43+ //
44+ //
45+ // }
46+
47+ }
You can’t perform that action at this time.
0 commit comments