test email signup flow
This commit is contained in:
parent
a95903ed05
commit
9945163a2f
12 changed files with 631 additions and 0 deletions
48
backend/tests/Fakes/FakeEmailer.php
Normal file
48
backend/tests/Fakes/FakeEmailer.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\Email\Emailer;
|
||||
use App\Shared\ValueObject\EmailAddress;
|
||||
|
||||
class FakeEmailer implements Emailer
|
||||
{
|
||||
private int $sendCount = 0;
|
||||
|
||||
private ?EmailAddress $lastRecipient = null;
|
||||
|
||||
private ?string $lastSubject = null;
|
||||
|
||||
private ?string $lastBody = null;
|
||||
|
||||
public function send(
|
||||
EmailAddress $recipient,
|
||||
string $subject,
|
||||
string $body,
|
||||
): void {
|
||||
$this->sendCount++;
|
||||
$this->lastRecipient = $recipient;
|
||||
$this->lastSubject = $subject;
|
||||
$this->lastBody = $body;
|
||||
}
|
||||
|
||||
public function getSendCount(): int
|
||||
{
|
||||
return $this->sendCount;
|
||||
}
|
||||
|
||||
public function getLastRecipient(): ?EmailAddress
|
||||
{
|
||||
return $this->lastRecipient;
|
||||
}
|
||||
|
||||
public function getLastSubject(): ?string
|
||||
{
|
||||
return $this->lastSubject;
|
||||
}
|
||||
|
||||
public function getLastBody(): ?string
|
||||
{
|
||||
return $this->lastBody;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue