Skip to content

Commit

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

protected $updated_at;

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

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

namespace Tests\Unit\Mail;

use App\Mail\PasswordChanged;
use Tests\TestCase;

class PasswordChangedTest extends TestCase
{
public function testMailable(): void
{
$mailable = new PasswordChanged('2023-12-05 18:00:00');

$mailable->assertSeeInText('Heads up! Your password has been changed (2023-12-05 18:00:00 CEST).');
}
}

0 comments on commit abac945

Please sign in to comment.