1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/16904] Refactor MCP tests

PHPBB3-16904
This commit is contained in:
rxu
2021-11-05 13:06:51 +07:00
parent da43c99fd6
commit c6640a8b1e
2 changed files with 143 additions and 3 deletions

View File

@@ -1190,9 +1190,12 @@ class phpbb_functional_test_case extends phpbb_test_case
return null;
}
$url = $crawler->selectLink($form_data['subject'])->link()->getUri();
$post_link = $crawler->filter('.postbody a[title="Post"]')->last()->attr('href');
$topic_link = $crawler->filter('h2[class="topic-title"] > a')->attr('href');
$post_id = $this->get_parameter_from_link($post_link, 'p');
$topic_id = $this->get_parameter_from_link($topic_link, 't');
$topic_id = $this->get_parameter_from_link($url, 't');
if (!$topic_id)
{
$topic_id = $form_data['topic_id'];
@@ -1200,7 +1203,7 @@ class phpbb_functional_test_case extends phpbb_test_case
return array(
'topic_id' => $topic_id,
'post_id' => $this->get_parameter_from_link($url, 'p'),
'post_id' => $post_id,
);
}