예제 #1
0
 protected function send()
 {
     /** @var EEmailManager $emailManager */
     $emailManager = Yii::app()->emailManager;
     $emailManager->email($emailManager->fromEmail, 'EmailManager subject', 'EmailManager message');
     $this->codeGuy->seeInDatabase('email_spool', array('subject' => 'EmailManager subject'));
     $this->assertEquals(EmailSpool::model()->unpack(EmailSpool::model()->pack('EmailManager message')), 'EmailManager message');
 }
 public function update()
 {
     $emailTemplate = EmailTemplate::model()->findByPk($this->emailTemplate->id);
     $emailTemplate->name = 'the name changed';
     $emailTemplate->subject = 'the subject changed';
     $emailTemplate->heading = 'the heading changed';
     $emailTemplate->message = 'the message changed';
     $save = $emailTemplate->save();
     $this->assertTrue($save);
     $this->codeGuy->seeInDatabase('email_template', array('name' => 'the name changed', 'subject' => 'the subject changed', 'heading' => 'the heading changed', 'message' => 'the message changed'));
 }
예제 #3
0
 protected function update()
 {
     $date = time();
     $emailSpool = EmailSpool::model()->findByPk($this->emailSpool->id);
     $emailSpool->transport = 'the transport changed';
     $emailSpool->template = 'the template changed';
     $emailSpool->priority = 100;
     $emailSpool->status = 'the status changed';
     $emailSpool->model_name = 'the model_name changed';
     $emailSpool->model_id = 'the model_id changed';
     $emailSpool->to_address = 'the to_address changed';
     $emailSpool->from_address = 'the from_address changed';
     $emailSpool->subject = 'the subject changed';
     $emailSpool->message = 'the message changed';
     $emailSpool->sent = $date;
     $emailSpool->created = $date;
     $save = $emailSpool->save();
     $this->assertTrue($save);
     $this->codeGuy->seeInDatabase('email_spool', array('transport' => 'the transport changed', 'template' => 'the template changed', 'priority' => 100, 'status' => 'the status changed', 'model_name' => 'the model_name changed', 'model_id' => 'the model_id changed', 'to_address' => 'the to_address changed', 'from_address' => 'the from_address changed', 'subject' => 'the subject changed', 'message' => 'the message changed', 'sent' => $date, 'created' => $date));
 }