diff options
| author | Dhruv <dhruv.goel92@gmail.com> | 2013-06-12 01:45:07 +0530 |
|---|---|---|
| committer | Dhruv <dhruv.goel92@gmail.com> | 2013-07-01 21:48:59 +0530 |
| commit | 43053c541ac0f998a3925b7277cfb77f1ceafb11 (patch) | |
| tree | 1a968d275b928ea79cbbf69af813d0b0ff098a09 | |
| parent | c4fbed251db058d808823d2700c441383edc3e63 (diff) | |
| download | forums-43053c541ac0f998a3925b7277cfb77f1ceafb11.tar forums-43053c541ac0f998a3925b7277cfb77f1ceafb11.tar.gz forums-43053c541ac0f998a3925b7277cfb77f1ceafb11.tar.bz2 forums-43053c541ac0f998a3925b7277cfb77f1ceafb11.tar.xz forums-43053c541ac0f998a3925b7277cfb77f1ceafb11.zip | |
[ticket/11566] add tests for reporting post
Functional test for reporting post and check if captcha validation
is required for guests and not for registerted users
PHPBB3-11566
| -rw-r--r-- | tests/functional/report_post_captcha.php | 55 |
1 files changed, 55 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..6b112c3538 --- /dev/null +++ b/tests/functional/report_post_captcha.php @@ -0,0 +1,55 @@ +<?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() + { + $this->enable_reporting_guest(); + $crawler = self::request('GET', 'report.php?f=2&p=1'); + $this->assertContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); + } + + protected function enable_reporting_guest() + { + $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); + + $form = $crawler->selectButton('Apply all permissions')->form(); + $values = $form->getValues(); + $values["setting[1][2][f_report]"] = 1; + $form->setValues($values); + $crawler = self::submit($form); + + $crawler = self::request('GET', 'ucp.php?mode=logout&sid=' . $this->sid); + } +} |
