public function testDeleteDevice()
 {
     $device = $this->testCreateDevice();
     $this->_deviceBackend->delete($device);
     $this->setExpectedException('Tinebase_Exception_NotFound');
     $this->_deviceBackend->get($device);
 }
 /**
  * set filter for different ActiveSync content types
  * 
  * @param unknown_type $_deviceId
  * @param unknown_type $_class
  * @param unknown_type $_filterId
  * 
  * @return ActiveSync_Model_Device
  */
 public function setDeviceContentFilter($_deviceId, $_class, $_filterId)
 {
     $device = $this->_backend->get($_deviceId);
     if ($device->owner_id != Tinebase_Core::getUser()->getId()) {
         throw new Tinebase_Exception_AccessDenied('not owner of device ' . $_deviceId);
     }
     $filterId = empty($_filterId) ? null : $_filterId;
     switch ($_class) {
         case Syncroton_Data_Factory::CLASS_CALENDAR:
             $device->calendarfilter_id = $filterId;
             break;
         case Syncroton_Data_Factory::CLASS_CONTACTS:
             $device->contactsfilter_id = $filterId;
             break;
         case Syncroton_Data_Factory::CLASS_EMAIL:
             $device->emailfilter_id = $filterId;
             break;
         case Syncroton_Data_Factory::CLASS_TASKS:
             $device->tasksfilter_id = $filterId;
             break;
         default:
             throw new ActiveSync_Exception('unsupported class ' . $_class);
     }
     $device = $this->_backend->update($device);
     return $device;
 }