Skip to content

Commit

Permalink
Test ResetPassword mail
Browse files Browse the repository at this point in the history
  • Loading branch information
range-of-motion committed Dec 29, 2023
1 parent b50fea3 commit 9919db7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/Mail/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ class ResetPassword extends Mailable
use Queueable;
use SerializesModels;

protected $token;

public function __construct($token)
{
$this->token = $token;
public function __construct(
protected $token
) {
//
}

public function build()
Expand Down
19 changes: 19 additions & 0 deletions tests/Unit/Mail/ResetPasswordTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Unit\Mail;

use App\Mail\ResetPassword;
use Tests\TestCase;

class ResetPasswordTest extends TestCase
{
public function testMailable(): void
{
$mailable = new ResetPassword('123456789');

$mailable->assertSeeInHtml(
string: '<a href="' . config('app.url') . '/reset_password?token=123456789">Click here to change your password</a>', // phpcs:ignore
escape: false,
);
}
}

0 comments on commit 9919db7

Please sign in to comment.