mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11040] Add methods to delete post and topic in functional tests
PHPBB3-11040
This commit is contained in:
parent
932e0eb17e
commit
b5310e9565
1 changed files with 44 additions and 0 deletions
|
@ -981,6 +981,50 @@ 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();
|
||||||
|
$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();
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
$this->assertContainsLang('POST_DELETED', $crawler->text());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the requested parameter from a URL
|
* Returns the requested parameter from a URL
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue