コード例 #1
0
 public static function resolveBounceObject()
 {
     if (static::isSetBounceImapSettings()) {
         $bounce = new ZurmoBounce();
         $bounceSettings = Yii::app()->params['emailTestAccounts']['bounceImapSettings'];
         $bounce->imapHost = $bounceSettings['imapHost'];
         $bounce->imapUsername = $bounceSettings['imapUsername'];
         $bounce->imapPassword = $bounceSettings['imapPassword'];
         $bounce->imapPort = $bounceSettings['imapPort'];
         $bounce->imapSSL = $bounceSettings['imapSSL'];
         $bounce->imapFolder = $bounceSettings['imapFolder'];
         $bounce->returnPath = $bounceSettings['returnPath'];
         $bounce->setInboundSettings();
         $bounce->init();
         return $bounce;
     }
     return false;
 }
コード例 #2
0
 public function testInit()
 {
     $bounce = new ZurmoBounce();
     $this->assertNull($bounce->imapHost);
     $this->assertNull($bounce->imapUsername);
     $this->assertNull($bounce->imapPassword);
     $this->assertEquals(143, $bounce->imapPort);
     $this->assertFalse($bounce->imapSSL);
     $this->assertEquals('INBOX', $bounce->imapFolder);
     $this->assertNull($bounce->returnPath);
     $bounce->init();
     $this->assertNull($bounce->imapHost);
     $this->assertNull($bounce->imapUsername);
     $this->assertNull($bounce->imapPassword);
     $this->assertEquals(143, $bounce->imapPort);
     $this->assertFalse($bounce->imapSSL);
     $this->assertEquals('INBOX', $bounce->imapFolder);
     $this->assertNull($bounce->returnPath);
     $form = new BounceConfigurationForm();
     $form->imapHost = 'bounce.com';
     $form->imapPort = '420';
     $form->imapUsername = '******';
     $form->imapPassword = '******';
     $form->imapFolder = 'BOUNCES';
     $form->returnPath = '*****@*****.**';
     $form->imapSSL = 1;
     BounceConfigurationFormAdapter::setConfigurationFromForm($form);
     $bounce = new ZurmoBounce();
     $bounce->init();
     $this->assertEquals('bounce.com', $bounce->imapHost);
     $this->assertEquals('bouncy', $bounce->imapUsername);
     $this->assertEquals('bounces', $bounce->imapPassword);
     $this->assertEquals('420', $bounce->imapPort);
     $this->assertEquals(1, $bounce->imapSSL);
     $this->assertEquals('BOUNCES', $bounce->imapFolder);
     $this->assertEquals('*****@*****.**', $bounce->returnPath);
 }