protected function _testGetDeviceInfo()
{
// First with no existing deivce.
$this->assertEquals(false, (bool) self::$state->deviceExists('dev123', 'mike'));
// Can't use setExpectedException here since it stops the rest
// of the method from running when it's thrown.
try {
self::$state->loadDeviceInfo('dev123', 'mike');
$this->fail('Did not raise expected Horde_ActiveSync_Exception.');
} catch (Horde_ActiveSync_Exception $e) {
}
// Add the device, then retreive it.
$deviceInfo = new Horde_ActiveSync_Device(self::$state);
$deviceInfo->rwstatus = 0;
$deviceInfo->deviceType = 'Test Device';
$deviceInfo->userAgent = 'Horde Tests';
$deviceInfo->id = 'dev123';
$deviceInfo->user = 'mike';
$deviceInfo->policykey = 456;
$deviceInfo->supported = array();
$deviceInfo->save();
$this->assertEquals(true, (bool) self::$state->deviceExists('dev123', 'mike'));
$di = self::$state->loadDeviceInfo('dev123', 'mike');
$this->assertEquals($deviceInfo, $di);
}