/**
  * test if the application parameter is used properly
  */
 public function testSearchTagsForApplication()
 {
     $this->_createSharedTag();
     $filter = new Tinebase_Model_TagFilter(array());
     $ids = $this->_instance->searchTags($filter)->getId();
     $this->_instance->deleteTags($ids);
     $t1 = $this->_createSharedTag('tag1');
     $t2 = $this->_createSharedTag('tag2');
     // this tag should not occur, search is in the addressbook application
     $crmAppId = Tinebase_Application::getInstance()->getApplicationByName('Crm')->getId();
     $t3 = $this->_createSharedTag('tag3', array($crmAppId));
     $filter = new Tinebase_Model_TagFilter(array('application' => 'Addressbook'));
     $tags = $this->_instance->searchTags($filter);
     $this->assertEquals(2, $tags->count());
 }
Ejemplo n.º 2
0
 /**
  * Tears down the fixture
  * This method is called after a test is executed.
  *
  * @access protected
  */
 protected function tearDown()
 {
     if (!empty($this->_tagIdsToDelete)) {
         $this->_instance->deleteTags($this->_tagIdsToDelete);
     }
 }