Example #1
0
 /**
  * test search tags
  */
 public function testSearchTags()
 {
     $sharedTag = $this->_createSharedTag();
     $filter = new Tinebase_Model_TagFilter(array('name' => 'tag::%'));
     $paging = new Tinebase_Model_Pagination();
     $tags = $this->_instance->searchTags($filter, $paging);
     $count = $this->_instance->getSearchTagsCount($filter);
     $this->assertTrue($count > 0, 'did not find created tag');
     $this->assertContains('tag::', $tags->getFirstRecord()->name);
 }
 /**
  * test search tags count
  * 
  * @see 0008170: wrong paging in admin menu for TAGS
  */
 public function testSearchTagsCount()
 {
     $filter = new Tinebase_Model_TagFilter(array('type' => Tinebase_Model_Tag::TYPE_SHARED));
     $count = $this->_instance->getSearchTagsCount($filter);
     if ($count < 50) {
         // create up to 50 tags
         for ($i = 0; $i < 50 - $count; $i++) {
             $this->_createSharedTag();
         }
     }
     $paging = new Tinebase_Model_Pagination(array('limit' => 50));
     $tags = $this->_instance->searchTags($filter, $paging);
     $count = $this->_instance->getSearchTagsCount($filter);
     $this->assertEquals(50, count($tags), 'did not find 50 tags');
     $this->assertGreaterThanOrEqual(50, $count, 'count mismatch');
 }