mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/12013] Fix functional tests and sniffer issue.
PHPBB3-12013
This commit is contained in:
@@ -971,12 +971,8 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
|
||||
*/
|
||||
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);
|
||||
$crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC');
|
||||
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
@@ -1067,4 +1063,25 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
|
||||
|
||||
return $manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quickmod page
|
||||
*
|
||||
* @param int $topic_id
|
||||
* @param string $action Language key for the quickmod action
|
||||
* @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one.
|
||||
* @return Symfony\Component\DomCrawler\Crawler
|
||||
*/
|
||||
public function get_quickmod_page($topic_id, $action, $crawler = false)
|
||||
{
|
||||
$this->add_lang('viewtopic');
|
||||
|
||||
if ($crawler === false)
|
||||
{
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
|
||||
}
|
||||
$link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri();
|
||||
|
||||
return self::request('GET', substr($link, strpos($link, 'mcp.')));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user