Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielpotthast/f3d8fa41239b9390c07b0066812dbada to your computer and use it in GitHub Desktop.
Save danielpotthast/f3d8fa41239b9390c07b0066812dbada to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Demo;
use Demo\MailerInterface;
use Demo\Message;
use Demo\NewsletterManager;
class NewsletterManagerTest extends \PHPUnit_Framework_TestCase
{
public function testNewsletterManager()
{
$message = new Message('Test Betreff', 'Test-Inhalt Newsletter');
$mailer = $this->prophesize(MailerInterface::class);
$mailer->send('[email protected]', $message)->shouldBeCalled();
$newsletterManager = new NewsletterManager();
$newsletterManager->setMailer($mailer->reveal());
$newsletterManager->sendMail(['[email protected]'], $message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment