public function test_count_tags()
 {
     $count = $this->tags_manager->count_tags();
     $this->assertEquals(3, $count);
     $this->tags_manager->delete_tag(1);
     $count = $this->tags_manager->count_tags();
     $this->assertEquals(2, $count);
 }
 /**
  * @param string $mode phpbb acp-mode
  * @param string $u_action phpbb acp-u_action
  * @param string $id
  */
 private function handle_delete($mode, $u_action, $id)
 {
     $tag_id = $this->request->variable('tag_id', -1);
     if ($tag_id < 1) {
         if ($this->request->is_ajax()) {
             trigger_error('TOPICTAGS_MISSING_TAG_ID', E_USER_WARNING);
         }
         trigger_error($this->user->lang('TOPICTAGS_MISSING_TAG_ID') . adm_back_link($u_action), E_USER_WARNING);
     }
     $tag = $this->tags_manager->get_tag_by_id($tag_id);
     if (confirm_box(true)) {
         $this->tags_manager->delete_tag($tag_id);
         if ($this->request->is_ajax()) {
             trigger_error('TOPICTAGS_TAG_DELETED');
         }
         trigger_error($this->user->lang('TOPICTAGS_TAG_DELETED') . adm_back_link($u_action));
     } else {
         $confirm_text = $this->user->lang('TOPICTAGS_TAG_DELETE_CONFIRM', $tag);
         confirm_box(false, $confirm_text, build_hidden_fields(array('i' => $id, 'mode' => $mode, 'action' => 'delete', 'tag_id' => $tag_id)));
     }
 }