/**
  * assert grant handling
  */
 public function testSaveResource($grants = array('readGrant' => true, 'editGrant' => true))
 {
     $resoureData = array('name' => Tinebase_Record_Abstract::generateUID(), 'email' => Tinebase_Record_Abstract::generateUID() . '@unittest.com', 'grants' => array(array_merge($grants, array('account_id' => Tinebase_Core::getUser()->getId(), 'account_type' => 'user'))));
     $resoureData = $this->_uit->saveResource($resoureData);
     $this->assertTrue(is_array($resoureData['grants']), 'grants are not resolved');
     return $resoureData;
 }
 /**
  * testRenameResource
  * 
  * @see 0010106: rename resource does not update container name
  */
 public function testRenameResource()
 {
     $resource = $this->_getResource();
     $createResource = Calendar_Controller_Resource::getInstance()->create($resource);
     $calenderFrontend = new Calendar_Frontend_Json();
     $resourceArrayFromDB = $calenderFrontend->getResource($createResource->getId());
     $resourceArrayFromDB['name'] = 'Other Room';
     $calenderFrontend->saveResource($resourceArrayFromDB);
     $containerFrontend = new Tinebase_Frontend_Json_Container();
     $result = $containerFrontend->getContainer('Calendar', Tinebase_Model_Container::TYPE_SHARED, '');
     foreach ($result as $container) {
         if ($container['id'] != $createResource->container_id) {
             continue;
         }
         $this->assertEquals($container['name'], 'Other Room');
     }
 }