namespace Tests\Dojo\HappyBirthday;
use Dojo\HappyBirthday\SendGreetings;
use PHPUnit\Framework\TestCase;
class SendGreetingsTest extends TestCase
{
public function testSendGreetingToCustomersWhenIsTheirBirthday()
{
$clockService = $this->getClockServiceStub();
$logger = $this->getLoggerDummy();
$customerRepository = $this->getCustomerRepositoryStub();
$mailer = $this->getMailerSpy([
new Customer('
[email protected]'),
new Customer('
[email protected]'),
new Customer('
[email protected]')
]);
$sendGreetings = new SendGreetings(
$clockService,
$customerRepository,
$mailer,
$logger
);
$sendGreetings->execute();
$this->assertEquals(3. $mailer->getMessagesSent());
}
}