1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

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
This commit is contained in:
Joas Schilling
2013-07-02 13:07:53 +02:00
5 changed files with 187 additions and 75 deletions

View File

@@ -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);
}
}