1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12960] Add tests for incomplete captcha

PHPBB3-12960
This commit is contained in:
Marc Alexander
2024-04-19 08:43:49 +02:00
parent 7da461eac4
commit d1e2e39469
5 changed files with 101 additions and 5 deletions

View File

@@ -14,6 +14,7 @@
namespace phpbb\captcha\plugins;
use phpbb\config\config;
use phpbb\exception\runtime_exception;
use phpbb\template\template;
class incomplete extends captcha_abstract
@@ -39,12 +40,14 @@ class incomplete extends captcha_abstract
}
/**
* Dummy implementation
* Dummy implementation, not supported by this captcha
*
* @throws runtime_exception
* @return void
*/
public function get_generator_class()
public function get_generator_class(): void
{
throw new runtime_exception('NO_GENERATOR_CLASS');
}
/**
@@ -65,6 +68,7 @@ class incomplete extends captcha_abstract
*/
public function init($type)
{
$this->type = (int) $type;
}
/**

View File

@@ -13,6 +13,8 @@
namespace phpbb\captcha\plugins;
use phpbb\exception\runtime_exception;
class recaptcha extends captcha_abstract
{
private $response;
@@ -55,10 +57,11 @@ class recaptcha extends captcha_abstract
/**
* This function is implemented because required by the upper class, but is never used for reCaptcha.
* @throws runtime_exception
*/
function get_generator_class()
{
throw new \Exception('No generator class given.');
throw new runtime_exception('NO_GENERATOR_CLASS');
}
function acp_page($id, $module)

View File

@@ -13,6 +13,8 @@
namespace phpbb\captcha\plugins;
use phpbb\exception\runtime_exception;
/**
* Google reCAPTCHA v3 plugin.
*/
@@ -86,12 +88,12 @@ class recaptcha_v3 extends captcha_abstract
*
* Not needed by this CAPTCHA plugin.
*
* @throws \Exception
* @throws runtime_exception
* @return void
*/
public function get_generator_class()
{
throw new \Exception('No generator class given.');
throw new runtime_exception('NO_GENERATOR_CLASS');
}
/**