public function testSendingMailWorks()
 {
     $message = new ParsedMessage();
     $message->setFrom('*****@*****.**', 'from');
     $message->setReplyTo('*****@*****.**');
     $message->addTo('*****@*****.**', 'to1');
     $message->addTo('*****@*****.**', 'to2');
     $message->addCc('*****@*****.**', 'cc1');
     $message->addCc('*****@*****.**', 'cc2');
     $message->addBcc('*****@*****.**', 'bcc1');
     $message->addBcc('*****@*****.**', 'bcc2');
     $message->setSubject('_subject');
     $message->setMessageText('_text_message');
     $message->setMessageHtml('_html_message');
     $this->mailer->send(Argument::type(\Swift_Message::class))->shouldBeCalled();
     $closureExceuted = false;
     $this->fixture->send($message, function (\Swift_Message $message) use(&$closureExceuted) {
         // from
         $this->assertEquals(['*****@*****.**' => 'from'], $message->getFrom());
         // reply-to
         $this->assertEquals(['*****@*****.**' => null], $message->getReplyTo());
         // to
         $this->assertEquals(['*****@*****.**' => 'to1', '*****@*****.**' => 'to2'], $message->getTo());
         // cc
         $this->assertEquals(['*****@*****.**' => 'cc1', '*****@*****.**' => 'cc2'], $message->getCc());
         // bcc
         $this->assertEquals(['*****@*****.**' => 'bcc1', '*****@*****.**' => 'bcc2'], $message->getBcc());
         $this->assertEquals('_subject', $message->getSubject());
         $this->assertEquals('_text_message', $message->getBody());
         $closureExceuted = true;
     });
     $this->assertTrue($closureExceuted, 'closure was not executed.');
 }