/** * test sync with non existing collection id */ public function testCreateDevice() { $newDevice = Syncope_Backend_DeviceTests::getTestDevice(); $device = $this->_deviceBackend->create($newDevice); #var_dump($device); return $device; }
/** * (non-PHPdoc) * @see ActiveSync/ActiveSync_TestCase::setUp() */ protected function setUp() { $this->_db = getTestDatabase(); $this->_db->beginTransaction(); $this->_deviceBackend = new Syncope_Backend_Device($this->_db); $this->_folderBackend = new Syncope_Backend_Folder($this->_db); $newDevice = Syncope_Backend_DeviceTests::getTestDevice(); $this->_device = $this->_deviceBackend->create($newDevice); }
/** * (non-PHPdoc) * @see ActiveSync/ActiveSync_TestCase::setUp() */ protected function setUp() { $this->_db = getTestDatabase(); $this->_db->beginTransaction(); $this->_contentBackend = new Syncope_Backend_Content($this->_db); $this->_deviceBackend = new Syncope_Backend_Device($this->_db); $this->_folderBackend = new Syncope_Backend_Folder($this->_db); $this->_syncStateBackend = new Syncope_Backend_SyncState($this->_db); $this->_device = $this->_deviceBackend->create(Syncope_Backend_DeviceTests::getTestDevice()); $this->_folder = $this->_folderBackend->create(Syncope_Backend_FolderTests::getTestFolder($this->_device)); }
/** * (non-PHPdoc) * @see Syncope/Syncope_TestCase::setUp() */ protected function setUp() { Syncope_Registry::setDatabase(getTestDatabase()); Syncope_Registry::setTransactionManager(Syncope_TransactionManager::getInstance()); Syncope_Registry::getTransactionManager()->startTransaction(Syncope_Registry::getDatabase()); #$writer = new Zend_Log_Writer_Null(); $writer = new Zend_Log_Writer_Stream('php://output'); $writer->addFilter(new Zend_Log_Filter_Priority($this->_logPriority)); $logger = new Zend_Log($writer); $this->_deviceBackend = new Syncope_Backend_Device(Syncope_Registry::getDatabase()); $this->_folderBackend = new Syncope_Backend_Folder(Syncope_Registry::getDatabase()); $this->_syncStateBackend = new Syncope_Backend_SyncState(Syncope_Registry::getDatabase()); $this->_contentStateBackend = new Syncope_Backend_Content(Syncope_Registry::getDatabase()); $this->_device = $this->_deviceBackend->create(Syncope_Backend_DeviceTests::getTestDevice()); Syncope_Registry::set('deviceBackend', $this->_deviceBackend); Syncope_Registry::set('folderStateBackend', $this->_folderBackend); Syncope_Registry::set('syncStateBackend', $this->_syncStateBackend); Syncope_Registry::set('contentStateBackend', $this->_contentStateBackend); Syncope_Registry::set('loggerBackend', $logger); Syncope_Registry::setContactsDataClass('Syncope_Data_Contacts'); Syncope_Registry::setCalendarDataClass('Syncope_Data_Calendar'); Syncope_Registry::setEmailDataClass('Syncope_Data_Email'); Syncope_Registry::setTasksDataClass('Syncope_Data_Tasks'); }
public function testDeleteEntry() { $device = $this->_deviceBackend->create(Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)); $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC'))); Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId']['foobar'] = array(); $this->assertArrayHasKey('foobar', Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']['addressbookFolderId']); $dataController->deleteEntry('addressbookFolderId', 'foobar', array()); $this->assertArrayNotHasKey('foobar', Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']['addressbookFolderId']); }