user = User::factory()->create(); $this->webauthnRecoveryNotification = new WebauthnRecoveryNotification('test_token'); } #[Test] public function test_it_renders_to_email() { $mail = $this->webauthnRecoveryNotification->toMail($this->user); $this->assertInstanceOf(MailMessage::class, $mail); } #[Test] public function test_rendered_email_contains_expected_data() { $mail = $this->webauthnRecoveryNotification->toMail($this->user)->render(); $this->assertStringContainsString( 'http://localhost/webauthn/recover?token=test_token&email=' . urlencode($this->user->email), $mail ); $this->assertStringContainsString( Lang::get('Recover Account'), $mail ); $this->assertStringContainsString( Lang::get( 'You are receiving this email because we received an account recovery request for your account.' ), $mail ); $this->assertStringContainsString( Lang::get( 'This recovery link will expire in :count minutes.', ['count' => config('auth.passwords.webauthn.expire')] ), $mail ); $this->assertStringContainsString( Lang::get('If you did not request an account recovery, no further action is required.'), $mail ); } }