public function setUp()
 {
     parent::setUp();
     if (!SendGridTestHelper::isSetSendGridAccountTestConfiguration()) {
         $this->markTestSkipped(Zurmo::t('SendGridModule', 'Email test settings are missing.'));
     }
 }
 public function setUp()
 {
     parent::setUp();
     if (!(EmailMessageTestHelper::isSetEmailAccountsTestConfiguration() && SendGridTestHelper::isSetSendGridAccountTestConfiguration())) {
         $this->markTestSkipped('Please fix the test email settings');
     }
     $this->user = User::getByUsername('super');
     Yii::app()->user->userModel = $this->user;
 }
 /**
  * @depends testSendQueued
  */
 public function testSendImmediately()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $emailMessage = SendGridTestHelper::createDraftSendGridSystemEmail('a test email 2', $super);
     $this->assertEquals(0, Yii::app()->emailHelper->getQueuedCount());
     $this->assertEquals(5, Yii::app()->emailHelper->getSentCount());
     Yii::app()->emailHelper->sendImmediately($emailMessage);
     $this->assertEquals(0, Yii::app()->emailHelper->getQueuedCount());
     $this->assertEquals(6, Yii::app()->emailHelper->getSentCount());
 }