/** * (non-PHPdoc) * @see ActiveSync/ActiveSync_TestCase::setUp() */ public function setUp() { $this->_db = ConnectionManager::getDataSource('test'); $this->_db->begin(); $this->_deviceBackend = new Syncroton_Backend_Device($this->_db); $this->_folderBackend = new Syncroton_Backend_Folder($this->_db); require_once dirname(__FILE__) . DS . 'DeviceTest.php'; $newDevice = DeviceTest::getTestDevice(); $this->_device = $this->_deviceBackend->create($newDevice); }
public function testGetUserDevice() { $device = $this->testCreateDevice(); $userDevice = $this->_deviceBackend->getUserDevice('1234', 'iphone-abcd'); $this->assertEquals($device->id, $userDevice->id); $this->setExpectedException('Syncroton_Exception_NotFound'); $userDevice = $this->_deviceBackend->getUserDevice('1234', 'iphone-xyz'); }