public function testGetUserDevice() { $device = $this->testCreateDevice(); $userDevice = $this->_deviceBackend->getUserDevice('1234', 'iphone-abcd'); $this->assertEquals($device->id, $userDevice->id); $this->setExpectedException('Syncope_Exception_NotFound'); $userDevice = $this->_deviceBackend->getUserDevice('1234', 'iphone-xyz'); }
/** * (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)); }