Ejemplo n.º 1
0
 public function testShouldRenderTwigParts()
 {
     $twig = $this->prophesize(\Twig_Environment::class);
     $twig->render('template.twig.html', [])->shouldBeCalled();
     $processor = new TwigProcessor($twig->reveal());
     $email = new Email();
     $email->addTo('*****@*****.**')->addPart(Email\TwigTemplatePart::create('template.twig.html'), 'text/html');
     $processor->onPreNotify(new PreNotifyEvent($email));
 }
Ejemplo n.º 2
0
 public function testShouldAddToAddresses()
 {
     $email = new Email();
     $email->addTo('*****@*****.**');
     $this->mailer->send(Argument::that(function ($argument) {
         if (!$argument instanceof \Swift_Message) {
             return false;
         }
         $this->assertCount(1, $argument->getTo());
         return true;
     }))->willReturn(1);
     $this->handler->notify($email);
 }