1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge remote-tracking branch 'dhruv/ticket/11040' into develop

* dhruv/ticket/11040:
  [ticket/11040] Topic is deleted if test is skipped
  [ticket/11040] Use unique text for the test post added
  [ticket/11040] Use hard delete in delete_topic
  [ticket/11040] Add migration to drop postgres search indexes
  [ticket/11040] Delete the functional test topic to avoid conflicts
  [ticket/11040] Add methods to delete post and topic in functional tests
  [ticket/11040] Swap post_text and post_subject for post_content index
  [ticket/11040] Add test cases for searching subject and post content together
  [ticket/11040] Remove postgres extra indexes
  [ticket/11040] Add post_content index
  [ticket/11040] Search subject and text together
This commit is contained in:
Joas Schilling
2014-03-14 10:13:42 +01:00
4 changed files with 115 additions and 19 deletions

View File

@@ -1003,6 +1003,52 @@ class phpbb_functional_test_case extends phpbb_test_case
);
}
/**
* Deletes a topic
*
* Be sure to login before creating
*
* @param int $topic_id
* @return null
*/
public function delete_topic($topic_id)
{
$crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
$this->add_lang('posting');
$form = $crawler->selectButton('Go')->eq(1)->form();
$form['action']->select('delete_topic');
$crawler = self::submit($form);
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$this->add_lang('mcp');
$form = $crawler->selectButton('Yes')->form();
$form['delete_permanent'] = 1;
$crawler = self::submit($form);
$this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
}
/**
* Deletes a post
*
* Be sure to login before creating
*
* @param int $forum_id
* @param int $topic_id
* @return null
*/
public function delete_post($forum_id, $post_id)
{
$this->add_lang('posting');
$crawler = self::request('GET', "posting.php?mode=delete&f={$forum_id}&p={$post_id}&sid={$this->sid}");
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$form = $crawler->selectButton('Yes')->form();
$form['delete_permanent'] = 1;
$crawler = self::submit($form);
$this->assertContainsLang('POST_DELETED', $crawler->text());
}
/**
* Returns the requested parameter from a URL
*