diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-02 13:07:53 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-02 13:07:53 +0200 |
| commit | ec4a43c91c4804e61b608bf1e524c8f6bac603f0 (patch) | |
| tree | bed1d5b3b3e1c6eaee33868907cac3bdb9e4d4c1 /tests | |
| parent | fb777b3e206a5b75a04ddacc89422f29c5253352 (diff) | |
| parent | c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1 (diff) | |
| download | forums-ec4a43c91c4804e61b608bf1e524c8f6bac603f0.tar forums-ec4a43c91c4804e61b608bf1e524c8f6bac603f0.tar.gz forums-ec4a43c91c4804e61b608bf1e524c8f6bac603f0.tar.bz2 forums-ec4a43c91c4804e61b608bf1e524c8f6bac603f0.tar.xz forums-ec4a43c91c4804e61b608bf1e524c8f6bac603f0.zip | |
Merge remote-tracking branch 'remotes/dhruvgoel92/ticket/11566-develop' into develop
* remotes/dhruvgoel92/ticket/11566-develop:
[ticket/11566] Subsilver template error displayed after table headers
[ticket/11566] Remove extra pair of brackets from conditional statement
[ticket/11566] Check that guest doesn't have reporting permission by default
[ticket/11566] Add captcha to report post template in subsilver
[ticket/11566] Use the new constant CONFIRM_REPORT for captcha init
[ticket/11566] Rename var to $visual_confirmation_response
[ticket/11566] Revert forum permission changes
[ticket/11566] Use language variable instead of hardcode
[ticket/11566] add tests for reporting post
[ticket/11566] add captcha reset and hidden fields
[ticket/11566] display error instead of trigger_error
[ticket/11566] add error in template
[ticket/11566] add error functionality
[ticket/11566] add interface for captcha
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/functional/report_post_captcha.php | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/functional/report_post_captcha.php b/tests/functional/report_post_captcha.php new file mode 100644 index 0000000000..af713775c5 --- /dev/null +++ b/tests/functional/report_post_captcha.php @@ -0,0 +1,61 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2013 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +/** + * @group functional + */ +class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_case +{ + public function test_user_report_post() + { + $this->login(); + $crawler = self::request('GET', 'report.php?f=2&p=1'); + $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); + } + + public function test_guest_report_post() + { + $crawler = self::request('GET', 'report.php?f=2&p=1'); + $this->add_lang('mcp'); + $this->assertContains($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text()); + + $this->set_reporting_guest(1); + $crawler = self::request('GET', 'report.php?f=2&p=1'); + $this->assertContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); + $this->set_reporting_guest(-1); + } + + protected function set_reporting_guest($report_post_allowed) + { + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?i=permissions&icat=12&mode=setting_group_local&sid=' . $this->sid); + $form = $crawler->selectButton('Submit')->form(); + $values = $form->getValues(); + $values["group_id[0]"] = 1; + $form->setValues($values); + $crawler = self::submit($form); + + $form = $crawler->selectButton('Submit')->form(); + $values = $form->getValues(); + $values["forum_id"] = 2; + $form->setValues($values); + $crawler = self::submit($form); + + $this->add_lang('acp/permissions'); + $form = $crawler->selectButton($this->lang('APPLY_ALL_PERMISSIONS'))->form(); + $values = $form->getValues(); + $values["setting[1][2][f_report]"] = $report_post_allowed; + $form->setValues($values); + $crawler = self::submit($form); + + $crawler = self::request('GET', 'ucp.php?mode=logout&sid=' . $this->sid); + } +} |
