test email signup flow

This commit is contained in:
Yisroel Baum 2026-08-03 20:22:50 +03:00
parent a95903ed05
commit 9945163a2f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
12 changed files with 631 additions and 0 deletions

View 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;
}
}