diff options
| author | Dhruv <dhruv.goel92@gmail.com> | 2013-07-01 23:25:29 +0530 |
|---|---|---|
| committer | Dhruv <dhruv.goel92@gmail.com> | 2013-07-01 23:25:29 +0530 |
| commit | c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1 (patch) | |
| tree | 5aae5584dd9fc1aed161bc4391865c8263486522 /tests | |
| parent | 8233c3e340a3608a6952ef444143a10e668d6561 (diff) | |
| parent | 045e04fb6fa55ae96ba82245010a684cd2d61e5d (diff) | |
| download | forums-c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1.tar forums-c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1.tar.gz forums-c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1.tar.bz2 forums-c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1.tar.xz forums-c80b80ca0f4328124bc4f2e8fdf9374aff06b7e1.zip | |
Merge branch 'ticket/11566' into ticket/11566-develop
* ticket/11566:
[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
Conflicts:
phpBB/report.php
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); + } +} |
