mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 13:58:54 +00:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/11720] Add functional test for submitting report as user [ticket/11720] Do not call $captcha->validate if $captcha is not set
This commit is contained in:
commit
fb5c8957ec
2 changed files with 18 additions and 10 deletions
|
@ -157,10 +157,13 @@ $s_hidden_fields = '';
|
||||||
// Submit report?
|
// Submit report?
|
||||||
if ($submit && $reason_id)
|
if ($submit && $reason_id)
|
||||||
{
|
{
|
||||||
$visual_confirmation_response = $captcha->validate();
|
if (isset($captcha))
|
||||||
if ($visual_confirmation_response)
|
|
||||||
{
|
{
|
||||||
$error[] = $visual_confirmation_response;
|
$visual_confirmation_response = $captcha->validate();
|
||||||
|
if ($visual_confirmation_response)
|
||||||
|
{
|
||||||
|
$error[] = $visual_confirmation_response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
|
|
|
@ -12,13 +12,6 @@
|
||||||
*/
|
*/
|
||||||
class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_case
|
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()
|
public function test_guest_report_post()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'report.php?f=2&p=1');
|
$crawler = self::request('GET', 'report.php?f=2&p=1');
|
||||||
|
@ -31,6 +24,18 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
|
||||||
$this->set_reporting_guest(-1);
|
$this->set_reporting_guest(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
|
||||||
|
$this->add_lang('mcp');
|
||||||
|
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
$this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
|
||||||
|
}
|
||||||
|
|
||||||
protected function set_reporting_guest($report_post_allowed)
|
protected function set_reporting_guest($report_post_allowed)
|
||||||
{
|
{
|
||||||
$this->login();
|
$this->login();
|
Loading…
Add table
Reference in a new issue