コード例 #1
0
 /**
  * Sets up the fixture.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->_iMIPFrontend = new Calendar_Frontend_iMIP();
     $this->_iMIPFrontendMock = new Calendar_Frontend_iMIPMock();
     try {
         $this->_emailTestClass = new Felamimail_Controller_MessageTest();
         $this->_emailTestClass->setup();
     } catch (Exception $e) {
         // do nothing
     }
 }
コード例 #2
0
 /**
  * set up test environment
  */
 protected function setUp()
 {
     $imapConfig = Tinebase_Config::getInstance()->getConfigAsArray(Tinebase_Config::IMAP);
     if (empty($imapConfig) || !array_key_exists('useSystemAccount', $imapConfig) || $imapConfig['useSystemAccount'] != true) {
         $this->markTestSkipped('IMAP backend not configured');
     }
     $this->_testUser = Tinebase_Core::getUser();
     $this->_domDocument = $this->_getOutputDOMDocument();
     $this->_emailTestClass = new Felamimail_Controller_MessageTest();
     $this->_emailTestClass->setup();
     $this->objects['devices'] = array();
 }
コード例 #3
0
 /**
  * Sets up the fixture.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     Calendar_Controller_Event::getInstance()->sendNotifications(true);
     Calendar_Config::getInstance()->set(Calendar_Config::DISABLE_EXTERNAL_IMIP, false);
     $this->_iMIPFrontend = new Calendar_Frontend_iMIP();
     $this->_iMIPFrontendMock = new Calendar_Frontend_iMIPMock();
     try {
         $this->_emailTestClass = new Felamimail_Controller_MessageTest();
         $this->_emailTestClass->setup();
     } catch (Exception $e) {
         // do nothing
     }
 }
コード例 #4
0
 /**
  * (non-PHPdoc)
  * @see ActiveSync/ActiveSync_TestCase::setUp()
  */
 protected function setUp()
 {
     $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP);
     if (!$imapConfig || !isset($imapConfig->useSystemAccount) || $imapConfig->useSystemAccount != TRUE) {
         $this->markTestSkipped('IMAP backend not configured');
     }
     $this->_emailTestClass = new Felamimail_Controller_MessageTest();
     $this->_emailTestClass->setup();
     $this->_createdMessages = new Tinebase_Record_RecordSet('Felamimail_Model_Message');
     Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
     $testDevice = ActiveSync_Backend_DeviceTests::getTestDevice();
     $this->objects['device'] = ActiveSync_Controller_Device::getInstance()->create($testDevice);
 }
 /**
  * testParallelAlarmTrigger
  * 
  * @see 0004878: improve asyncJob fencing
  */
 public function testParallelAlarmTrigger()
 {
     $this->_testNeedsTransaction();
     try {
         $this->_emailTestClass = new Felamimail_Controller_MessageTest();
         $this->_emailTestClass->setup();
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $this->markTestIncomplete('email not available.');
     }
     Tinebase_Alarm::getInstance()->sendPendingAlarms("Tinebase_Event_Async_Minutely");
     self::flushMailer();
     $this->_getAlarmMails(TRUE);
     $event = $this->_getEvent();
     $event->dtstart = Tinebase_DateTime::now()->addMinute(15);
     $event->dtend = clone $event->dtstart;
     $event->dtend->addMinute(30);
     $event->attendee = $this->_getAttendee();
     $event->alarms = new Tinebase_Record_RecordSet('Tinebase_Model_Alarm', array(new Tinebase_Model_Alarm(array('minutes_before' => 30), TRUE)));
     $persistentEvent = $this->_eventController->create($event);
     try {
         Tinebase_AsyncJobTest::triggerAsyncEvents();
     } catch (Exception $e) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Something strange happened and the async jobs did not complete ... maybe the test system is not configured correctly for this: ' . $e);
         $this->markTestIncomplete($e->getMessage());
     }
     $result = $this->_getAlarmMails(TRUE);
     $this->assertEquals(1, count($result), 'expected exactly 1 alarm mail, got: ' . print_r($result->toArray(), TRUE));
 }
コード例 #6
0
 /**
  * Sets up the fixture.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     if (Tinebase_User::getConfiguredBackend() === Tinebase_User::ACTIVEDIRECTORY) {
         // account email addresses are empty with AD backend
         $this->markTestSkipped('skipped for ad backend');
     }
     Calendar_Controller_Event::getInstance()->sendNotifications(true);
     Calendar_Config::getInstance()->set(Calendar_Config::DISABLE_EXTERNAL_IMIP, false);
     $this->_iMIPFrontend = new Calendar_Frontend_iMIP();
     $this->_iMIPFrontendMock = new Calendar_Frontend_iMIPMock();
     try {
         $this->_emailTestClass = new Felamimail_Controller_MessageTest();
         $this->_emailTestClass->setup();
     } catch (Exception $e) {
         // do nothing
     }
 }
 /**
  * Sets up the fixture.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     // get (or create) test accout
     $this->_account = Expressomail_Controller_Account::getInstance()->search()->getFirstRecord();
     // init controller and imap backend
     $this->_controller = Felamimail_Controller_Cache_Message::getInstance();
     $this->_imap = Expressomail_Backend_ImapFactory::factory($this->_account);
     try {
         $this->_imap->createFolder($this->_testFolderName, '', $this->_account->delimiter);
     } catch (Zend_Mail_Storage_Exception $zmse) {
         // exists
     }
     $this->_imap->selectFolder($this->_testFolderName);
     // init folder cache and get INBOX
     //Expressomail_Controller_Cache_Folder::getInstance()->update($this->_account->getId());
     $this->_folder = $this->_getFolder($this->_testFolderName);
     $this->_emailTestClass = new Expressomail_Controller_MessageTest();
     $this->_emailTestClass->setup();
 }
 /**
  * set up test environment
  * 
  * @todo move setup to abstract test case
  */
 protected function setUp()
 {
     parent::setUp();
     $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
     if (empty($imapConfig) || !(isset($imapConfig['useSystemAccount']) || array_key_exists('useSystemAccount', $imapConfig)) || $imapConfig['useSystemAccount'] != true) {
         $this->markTestSkipped('IMAP backend not configured');
     }
     $this->_testUser = Tinebase_Core::getUser();
     $this->_emailTestClass = new Felamimail_Controller_MessageTest();
     $this->_emailTestClass->setup();
     $this->_createdMessages = new Tinebase_Record_RecordSet('Felamimail_Model_Message');
     $this->objects['devices'] = array();
     Syncroton_Registry::set(Syncroton_Registry::DEVICEBACKEND, new Syncroton_Backend_Device(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::FOLDERBACKEND, new Syncroton_Backend_Folder(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::SYNCSTATEBACKEND, new Syncroton_Backend_SyncState(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set(Syncroton_Registry::CONTENTSTATEBACKEND, new Syncroton_Backend_Content(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::set('loggerBackend', Tinebase_Core::getLogger());
     Syncroton_Registry::set(Syncroton_Registry::POLICYBACKEND, new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
     Syncroton_Registry::setContactsDataClass('Addressbook_Frontend_ActiveSync');
     Syncroton_Registry::setCalendarDataClass('Calendar_Frontend_ActiveSync');
     Syncroton_Registry::setEmailDataClass('Felamimail_Frontend_ActiveSync');
     Syncroton_Registry::setTasksDataClass('Tasks_Frontend_ActiveSync');
 }