M3 Integration fixes pass 20
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Feature\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Events\Verified;
|
||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
@@ -36,11 +37,7 @@ class EmailVerificationTest extends TestCase
|
||||
|
||||
Event::fake();
|
||||
|
||||
$verificationUrl = URL::temporarySignedRoute(
|
||||
'verification.verify',
|
||||
now()->addMinutes(60),
|
||||
['id' => $user->id, 'hash' => sha1($user->email)],
|
||||
);
|
||||
$verificationUrl = (new TestVerifyEmail)->urlFor($user);
|
||||
|
||||
$response = $this->actingAs($user)->get($verificationUrl);
|
||||
|
||||
@@ -57,7 +54,7 @@ class EmailVerificationTest extends TestCase
|
||||
$verificationUrl = URL::temporarySignedRoute(
|
||||
'verification.verify',
|
||||
now()->addMinutes(60),
|
||||
['id' => $user->id, 'hash' => sha1('wrong-email')],
|
||||
['id' => $user->id, 'hash' => hash('sha256', 'wrong-email')],
|
||||
);
|
||||
|
||||
$this->actingAs($user)->get($verificationUrl);
|
||||
@@ -73,11 +70,7 @@ class EmailVerificationTest extends TestCase
|
||||
|
||||
Event::fake();
|
||||
|
||||
$verificationUrl = URL::temporarySignedRoute(
|
||||
'verification.verify',
|
||||
now()->addMinutes(60),
|
||||
['id' => $user->id, 'hash' => sha1($user->email)],
|
||||
);
|
||||
$verificationUrl = (new TestVerifyEmail)->urlFor($user);
|
||||
|
||||
$this->actingAs($user)->get($verificationUrl)
|
||||
->assertRedirect(route('dashboard', absolute: false) . '?verified=1');
|
||||
@@ -86,3 +79,12 @@ class EmailVerificationTest extends TestCase
|
||||
Event::assertNotDispatched(Verified::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final class TestVerifyEmail extends VerifyEmail
|
||||
{
|
||||
public function urlFor(User $user): string
|
||||
{
|
||||
return $this->verificationUrl($user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user