コード例 #1
0
ファイル: MailsLogTest.php プロジェクト: ChristopheBrun/hLib
 /**
  * @test
  */
 public function create()
 {
     $this->assertInstanceOf('MailsLog', MailsLog::model());
     $model = new MailsLog();
     $model->attributes = array('from' => '*****@*****.**', 'to' => '*****@*****.**', 'body' => '<div>texte du mail</div>', 'type' => 'CourrierTest');
     $this->assertFalse($model->save());
     $model = new MailsLog();
     $model->attributes = array('mail_date' => "2014/08/01 12:00:00", 'to' => '*****@*****.**', 'body' => '<div>texte du mail</div>', 'type' => 'CourrierTest');
     $this->assertFalse($model->save());
     $model = new MailsLog();
     $model->attributes = array('mail_date' => "2014/08/01 12:00:00", 'from' => '*****@*****.**', 'body' => '<div>texte du mail</div>', 'type' => 'CourrierTest');
     $this->assertFalse($model->save());
     $model = new MailsLog();
     $model->attributes = array('mail_date' => "2014/08/01 12:00:00", 'from' => '*****@*****.**', 'to' => '*****@*****.**', 'type' => 'CourrierTest');
     $this->assertFalse($model->save());
     $model = new MailsLog();
     $model->attributes = array('mail_date' => "2014/08/01 12:00:00", 'from' => '*****@*****.**', 'to' => '*****@*****.**', 'body' => '<div>texte du mail</div>');
     $this->assertFalse($model->save());
     $model = new MailsLog();
     $model->attributes = array('mail_date' => "2014/08/01 12:00:00", 'from' => '*****@*****.**', 'to' => '*****@*****.**', 'body' => '<div>texte du mail</div>', 'type' => 'CourrierTest');
     $this->assertTrue($model->save());
 }