13 'wgCaptchaTriggers' => [
14 $action => $expectedResult,
17 $this->assertEquals( $expectedResult, $captcha->triggersCaptcha( $action ) );
22 $captchaTriggers =
new ReflectionClass( CaptchaTriggers::class );
23 $constants = $captchaTriggers->getConstants();
24 foreach ( $constants as $const ) {
25 $data[] = [ $const,
true ];
26 $data[] = [ $const,
false ];
37 'wgCaptchaTriggers' => [
38 $trigger => !$expected,
40 'wgCaptchaTriggersOnNamespace' => [
42 $trigger => $expected,
46 $title = Title::newFromText(
'Main' );
47 $this->assertEquals( $expected, $captcha->triggersCaptcha( $trigger, $title ) );
64 'CaptchaTriggers' => [
68 'autoloaderPaths' => []
71 $class =
new ReflectionClass(
'ExtensionRegistry' );
72 $instanceProperty = $class->getProperty(
'instance' );
73 $instanceProperty->setAccessible(
true );
74 $instanceProperty->setValue( $registry );
75 $method = $class->getMethod(
'exportExtractedData' );
76 $method->setAccessible(
true );
77 $method->invokeArgs( $registry, [ $info ] );
86 $this->assertEquals(
$value, $captcha->triggersCaptcha( $trigger ) );
101 'wgCaptchaTriggers' => [
102 $trigger => $expected
107 $this->assertEquals( $expected, $captcha->triggersCaptcha( $trigger ) );
testNamespaceTriggersOverwrite( $trigger, $expected)
provideNamespaceOverwrites
provideNamespaceOverwrites()
testCaptchaTriggersAttributeGetsOverwritten( $trigger, $expected)
provideAttributeOverwritten
setCaptchaTriggersAttribute( $trigger, $value)
testTriggersCaptcha( $action, $expectedResult)
provideSimpleTriggersCaptcha
provideAttributeOverwritten()
provideSimpleTriggersCaptcha()
testCaptchaTriggersAttributeSetTrue( $trigger, $value)
provideAttributeSet
Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
processing should stop and the error should be shown to the user * false