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

[ticket/8610] Move posting helpers to separate file

This is to prevent cluttering up the functional test case class more

PHPBB3-8610
This commit is contained in:
Nathan Guse
2012-12-13 23:09:45 -06:00
parent 9eb9fa2b9d
commit d739745ea4
3 changed files with 137 additions and 105 deletions

View File

@@ -15,15 +15,19 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
public function test_post_new_topic()
{
$this->login();
include(__DIR__ . './../test_framework/posting_helpers.php');
$posting_helper = new phpbb_test_framework_posting_helpers($this);
// Test creating topic
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
$post = $posting_helper->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
$crawler = $this->request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
$this->assertContains('This is a test topic posted by the testing framework.', $crawler->filter('html')->text());
// Test creating a reply
$post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post posted by the testing framework.');
$post2 = $posting_helper->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post posted by the testing framework.');
$crawler = $this->request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());