コード例 #1
0
ファイル: ServiceTest.php プロジェクト: Ryan-Nolan/boxbilling
 public function testResend()
 {
     $service = new \Box\Mod\Email\Service();
     $di = new \Box_Di();
     $db = $this->getMockBuilder('Box_Database')->getMock();
     $mailMock = $this->getMockBuilder('Box_Mail')->getMock();
     $emailSettings = array('mailer' => 'sendmail', 'smtp_authentication' => 'login', 'smtp_host' => NULL, 'smtp_security' => NULL, 'smtp_port' => NULL, 'smtp_username' => NULL, 'smtp_password' => NULL);
     $di['db'] = $db;
     $di['mail'] = $mailMock;
     $config = array();
     $di['mod_config'] = $di->protect(function ($modName) use($config) {
         return $config;
     });
     $di['logger'] = $this->getMockBuilder('Box_Log')->getMock();
     $di['array_get'] = $di->protect(function (array $array, $key, $default = null) use($di) {
         return isset($array[$key]) ? $array[$key] : $default;
     });
     $service->setDi($di);
     $model = new \Model_ActivityClientEmail();
     $model->loadBean(new \RedBeanPHP\OODBBean());
     $model->client_id = 1;
     $model->sender = '*****@*****.**';
     $model->recipients = '*****@*****.**';
     $model->subject = 'Email Title';
     $model->content_html = '<b>Content</b>';
     $model->content_text = 'Content';
     $result = $service->resend($model);
     $this->assertTrue($result);
 }