Ejemplo n.º 1
0
 public function testSetTo()
 {
     $this->assertEquals($this->message, $this->message->setTo($this->email));
     $this->headers->set('To', $this->email);
     $this->assertEquals($this->email, $this->message->getTo());
     $this->assertEquals($this->headers->toString(), $this->message->getHeaders());
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider getRecipients
  */
 public function testNotify(array $base, array $recipients)
 {
     $message = new Message();
     foreach ($base as $to) {
         $this->queue->add($message->setTo($to));
     }
     $this->assertEquals($this->queue, $this->queue->notify($recipients, $message));
     // check list messages
     $this->assertEquals(count($recipients) + count($base), $this->queue->count());
     $expected = array_merge($base, $recipients);
     $expected_message = new Message();
     foreach ($this->queue as $key => $message) {
         /* @var $message \Sendmail\Message */
         $expected_message->setTo($expected[$key]);
         $this->assertEquals($expected_message->getHeaders(), $message->getHeaders());
     }
 }