/** * (non-PHPdoc) * @see ActiveSync/ActiveSync_TestCase::setUp() */ protected function setUp() { parent::setUp(); Syncroton_Registry::setDatabase(Tinebase_Core::getDb()); Syncroton_Registry::setTransactionManager(Tinebase_TransactionManager::getInstance()); 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(Syncroton_Registry::POLICYBACKEND, new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_')); Syncroton_Registry::set('loggerBackend', Tinebase_Core::getLogger()); Syncroton_Registry::setContactsDataClass('Addressbook_Frontend_ActiveSync'); Syncroton_Registry::setCalendarDataClass('Calendar_Frontend_ActiveSync'); Syncroton_Registry::setEmailDataClass('Felamimail_Frontend_ActiveSync'); Syncroton_Registry::setTasksDataClass('Tasks_Frontend_ActiveSync'); $this->_device = Syncroton_Registry::getDeviceBackend()->create(ActiveSync_TestCase::getTestDevice()); }
public static function initSyncrotonRegistry() { Syncroton_Registry::setDatabase(Tinebase_Core::getDb()); Syncroton_Registry::setTransactionManager(Tinebase_TransactionManager::getInstance()); 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(Syncroton_Registry::POLICYBACKEND, new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_')); Syncroton_Registry::set(Syncroton_Registry::LOGGERBACKEND, Tinebase_Core::getLogger()); Syncroton_Registry::set(Syncroton_Registry::SESSION_VALIDATOR, function () { return !Tinebase_Core::inMaintenanceMode(); }); }