aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/posting_test.php
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-06-06 17:21:01 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-06-06 17:21:01 -0500
commit6bc775a75bdb4d4984eba10fba253c4cc75542d1 (patch)
treee9a254aa34b872d99244d09e715a8b3371382ec7 /tests/functional/posting_test.php
parentb4b1704a9b2f2c6e7770f478e27c5c408772f3ff (diff)
parent1d7c80b91210337845ae33267131bb82473b9a9f (diff)
downloadforums-6bc775a75bdb4d4984eba10fba253c4cc75542d1.tar
forums-6bc775a75bdb4d4984eba10fba253c4cc75542d1.tar.gz
forums-6bc775a75bdb4d4984eba10fba253c4cc75542d1.tar.bz2
forums-6bc775a75bdb4d4984eba10fba253c4cc75542d1.tar.xz
forums-6bc775a75bdb4d4984eba10fba253c4cc75542d1.zip
Merge remote-tracking branch 'remotes/nickv/ticket/11568-develop' into develop
# By Joas Schilling # Via Joas Schilling * remotes/nickv/ticket/11568-develop: (21 commits) [ticket/11568] Split status code and html debug assertion into two methods [ticket/11568] Add comma at end of array key-value couple [ticket/11568] Invert logic for asserting the response [ticket/11568] Use static calls for static methods [ticket/develop/11568] Remove unneccessary second call with wrong arguments [ticket/11568] Remove unused method [ticket/11568] Only assert string when doctype is there at all [ticket/develop/11568] Fix some more tests in 3.1 [ticket/develop/11568] Remove php extension parameter [ticket/develop/11568] Remove unneccessary calls to assert_response_success() [ticket/develop/11568] Do not directly access $client from tests [ticket/11568] Add method to get page content [ticket/11568] Allow different status codes [ticket/11568] Trim the output to allow Tabs before INCLUDE overall_header [ticket/11568] Fix common_groups_test.php form handling [ticket/11568] Make CookieJar static aswell [ticket/11568] Remove manual calls to assert_response_success() [ticket/11568] Only use a static version of the client [ticket/11568] Any output before the doc type means there was an error [ticket/11568] Set client manually so we can increase the cURL timeout ...
Diffstat (limited to 'tests/functional/posting_test.php')
-rw-r--r--tests/functional/posting_test.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index d05207edf0..9bcfcc2fda 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -19,18 +19,17 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
// Test creating topic
$post = $this->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}");
+ $crawler = self::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.');
- $crawler = $this->request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+ $crawler = self::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());
// Test quoting a message
- $crawler = $this->request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
- $this->assert_response_success();
+ $crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
}
@@ -55,7 +54,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
'post' => true,
), $additional_form_data);
- return $this->submit_post($posting_url, 'POST_TOPIC', $form_data);
+ return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
}
/**
@@ -79,7 +78,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
'post' => true,
), $additional_form_data);
- return $this->submit_post($posting_url, 'POST_REPLY', $form_data);
+ return self::submit_post($posting_url, 'POST_REPLY', $form_data);
}
/**
@@ -94,8 +93,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
{
$this->add_lang('posting');
- $crawler = $this->request('GET', $posting_url);
- $this->assert_response_success();
+ $crawler = self::request('GET', $posting_url);
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
$hidden_fields = array(
@@ -119,8 +117,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
// I use a request because the form submission method does not allow you to send data that is not
// contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs)
// Instead, I send it as a request with the submit button "post" set to true.
- $crawler = $this->client->request('POST', $posting_url, $form_data);
- $this->assert_response_success();
+ $crawler = self::request('POST', $posting_url, $form_data);
$this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
$url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();