26 'wgCaptchaTriggers' => [
27 $action => $expectedResult,
30 $this->
assertEquals( $expectedResult, $captcha->triggersCaptcha( $action ) );
36 $constants = $captchaTriggers->getConstants();
37 foreach ( $constants as $const ) {
50 'wgCaptchaTriggers' => [
51 $trigger => !$expected,
53 'wgCaptchaTriggersOnNamespace' => [
55 $trigger => $expected,
59 $title = Title::newFromText(
'Main' );
60 $this->
assertEquals( $expected, $captcha->triggersCaptcha( $trigger, $title ) );
76 TestingAccessWrapper::newFromClass( ExtensionProcessor::class )->globalSettings;
78 foreach (
$keys as $key ) {
79 $globalsToStash[
"wg$key"] =
$GLOBALS[
"wg$key"];
89 'CaptchaTriggers' => [
93 'autoloaderPaths' => []
96 'CaptchaTriggers', [ $trigger =>
$value ]
121 'wgCaptchaTriggers' => [
122 $trigger => $expected
127 $this->
assertEquals( $expected, $captcha->triggersCaptcha( $trigger ) );
142 $user = $this->
getMock( User::class );
143 $user->method(
'isAllowed' )->willReturn( $userIsAllowed );
145 $actual = $testObject->canSkipCaptcha( $user, RequestContext::getMain()->getConfig() );
165 $userIsMailConfirmed, $expected ) {
167 $user = $this->
getMock( User::class );
168 $user->method(
'isEmailConfirmed' )->willReturn( $userIsMailConfirmed );
169 $config = $this->
getMock( Config::class );
170 $config->method(
'get' )->willReturn( $allowUserConfirmEmail );
172 $actual = $testObject->canSkipCaptcha( $user, $config );
179 [
false,
false,
false ],
180 [
false,
true,
false ],
181 [
true,
false,
false ],
182 [
true,
true,
true ],
195 $config = $this->
getMock( Config::class );
197 $request->method(
'getIP' )->willReturn( $requestIP );
201 'wgCaptchaWhitelistIP' => $IPWhitelist
204 $actual = $testObject->canSkipCaptcha( RequestContext::getMain()->getUser(), $config );
211 [
'127.0.0.1', [
'127.0.0.1',
'127.0.0.2' ],
true ],
212 [
'127.0.0.1', [],
false ]
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testNamespaceTriggersOverwrite( $trigger, $expected)
provideNamespaceOverwrites
provideNamespaceOverwrites()
provideCanSkipCaptchaIPWhitelisted()
testCaptchaTriggersAttributeGetsOverwritten( $trigger, $expected)
provideAttributeOverwritten
provideCanSkipCaptchaUserright()
testCanSkipCaptchaUserright( $userIsAllowed, $expected)
provideCanSkipCaptchaUserright
testCanSkipCaptchaMailconfirmed( $allowUserConfirmEmail, $userIsMailConfirmed, $expected)
setCaptchaTriggersAttribute( $trigger, $value)
testTriggersCaptcha( $action, $expectedResult)
provideSimpleTriggersCaptcha
provideAttributeOverwritten()
provideCanSkipCaptchaMailconfirmed()
provideSimpleTriggersCaptcha()
testCanSkipCaptchaIPWhitelisted( $requestIP, $IPWhitelist, $expected)
testCaptchaTriggersAttributeSetTrue( $trigger, $value)
provideAttributeSet
Demo CAPTCHA (not for production usage) and base class for real CAPTCHAs.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
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
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)