Skip to content

Commit eecc616

Browse files
committed
Removes usage of RouteServiceProvider
1 parent 084f64c commit eecc616

6 files changed

+6
-10
lines changed

Diff for: stubs/pest-tests/AuthenticationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use App\Models\User;
4-
use App\Providers\RouteServiceProvider;
54

65
test('login screen can be rendered', function () {
76
$response = $this->get('/login');
@@ -18,7 +17,7 @@
1817
]);
1918

2019
$this->assertAuthenticated();
21-
$response->assertRedirect(RouteServiceProvider::HOME);
20+
$response->assertRedirect(route('dashboard', absolute: false));
2221
});
2322

2423
test('users cannot authenticate with invalid password', function () {

Diff for: stubs/pest-tests/EmailVerificationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use App\Models\User;
4-
use App\Providers\RouteServiceProvider;
54
use Illuminate\Auth\Events\Verified;
65
use Illuminate\Support\Facades\Event;
76
use Illuminate\Support\Facades\URL;
@@ -37,7 +36,7 @@
3736
Event::assertDispatched(Verified::class);
3837

3938
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
40-
$response->assertRedirect(RouteServiceProvider::HOME.'?verified=1');
39+
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
4140
})->skip(function () {
4241
return ! Features::enabled(Features::emailVerification());
4342
}, 'Email verification not enabled.');

Diff for: stubs/pest-tests/RegistrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]);
3131

3232
$this->assertAuthenticated();
33-
$response->assertRedirect(RouteServiceProvider::HOME);
33+
$response->assertRedirect(route('dashboard', absolute: false));
3434
})->skip(function () {
3535
return ! Features::enabled(Features::registration());
3636
}, 'Registration support is not enabled.');

Diff for: stubs/tests/AuthenticationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Tests\Feature;
44

55
use App\Models\User;
6-
use App\Providers\RouteServiceProvider;
76
use Illuminate\Foundation\Testing\RefreshDatabase;
87
use Tests\TestCase;
98

@@ -28,7 +27,7 @@ public function test_users_can_authenticate_using_the_login_screen(): void
2827
]);
2928

3029
$this->assertAuthenticated();
31-
$response->assertRedirect(RouteServiceProvider::HOME);
30+
$response->assertRedirect(route('dashboard', absolute: false));
3231
}
3332

3433
public function test_users_can_not_authenticate_with_invalid_password(): void

Diff for: stubs/tests/EmailVerificationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Tests\Feature;
44

55
use App\Models\User;
6-
use App\Providers\RouteServiceProvider;
76
use Illuminate\Auth\Events\Verified;
87
use Illuminate\Foundation\Testing\RefreshDatabase;
98
use Illuminate\Support\Facades\Event;
@@ -53,7 +52,7 @@ public function test_email_can_be_verified(): void
5352
Event::assertDispatched(Verified::class);
5453

5554
$this->assertTrue($user->fresh()->hasVerifiedEmail());
56-
$response->assertRedirect(RouteServiceProvider::HOME.'?verified=1');
55+
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
5756
}
5857

5958
public function test_email_can_not_verified_with_invalid_hash(): void

Diff for: stubs/tests/RegistrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public function test_new_users_can_register(): void
5555
]);
5656

5757
$this->assertAuthenticated();
58-
$response->assertRedirect(RouteServiceProvider::HOME);
58+
$response->assertRedirect(route('dashboard', absolute: false));
5959
}
6060
}

0 commit comments

Comments
 (0)