File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ APP_DEBUG=true
55APP_LOG_LEVEL=debug
66APP_URL=http://localhost:8000
77
8- DB_CONNECTION=mysql
8+ DB_CONNECTION=testing
99DB_HOST=127.0.0.1
1010DB_PORT=3306
1111DB_DATABASE=budget
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Browser ;
4+
5+ use App \Models \User ;
6+ use Illuminate \Foundation \Testing \DatabaseMigrations ;
7+ use Illuminate \Support \Facades \Hash ;
8+ use Laravel \Dusk \Browser ;
9+ use Tests \DuskTestCase ;
10+
11+ class DeleteUserTest extends DuskTestCase
12+ {
13+ public function testSuccess (): void
14+ {
15+ $ password = 'hoi ' ;
16+
17+ $ user = factory (User::class)->create ([
18+ 'password ' => Hash::make ($ password )
19+ ]);
20+
21+ $ this ->browse (function (Browser $ browser ) use ($ user , $ password ) {
22+ $ browser
23+ ->assertGuest ()
24+ ->visit ('/login ' )
25+ ->type ('email ' , $ user ->email )
26+ ->type ('password ' , $ password )
27+ ->press ('Log in ' )
28+ ->assertAuthenticated ()
29+ ->visit ('/settings/account ' )
30+ ->press ('Delete ' )
31+ ->press ('Yes, I am sure ' )
32+ ->assertGuest ();
33+ });
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments