Esempio n. 1
0
 function testUser()
 {
     $user = User::getNewInstance('*****@*****.**');
     $user->firstName->set('test');
     $user->lastName->set('recipient');
     Swift_Connection_Fake::resetBuffer();
     $user->save();
     //var_dump(Swift_Connection_Fake::getBuffer());
     $email = new Email(self::getApplication());
     $email->setFrom('*****@*****.**', 'Unit Test');
     $email->setSubject('test');
     $email->setText('some text');
     $email->setUser($user);
     $res = $email->send();
     $this->assertTrue(strpos($email->getMessage()->getHeaders()->get('To'), $user->email->get()) !== false);
     $this->assertEqual($res, 1);
 }