MediaWiki
1.34.0
|
@covers CaptchaPreAuthenticationProvider @group Database More...
Public Member Functions | |
provideGetAuthenticationRequests () | |
providePingLimiter () | |
provideTestForAccountCreation () | |
provideTestForAuthentication () | |
setUp () | |
tearDown () | |
testGetAuthenticationRequests ( $action, $username, $triggers, $needsCaptcha, $preTestCallback=null) | |
@dataProvider provideGetAuthenticationRequests More... | |
testGetAuthenticationRequests_store () | |
testPingLimiter (array $attempts) | |
@dataProvider providePingLimiter More... | |
testPostAuthentication () | |
testPostAuthentication_disabled () | |
testTestForAccountCreation ( $req, $creator, $result, $disableTrigger=false) | |
@dataProvider provideTestForAccountCreation More... | |
testTestForAuthentication ( $req, $isBadLoginTriggered, $isBadLoginPerUserTriggered, $result) | |
@dataProvider provideTestForAuthentication More... | |
Protected Member Functions | |
blockLogin ( $username) | |
flagSession () | |
getCaptchaRequest ( $id, $word, $username=null) | |
setMwHook ( $hook, callable $callback) | |
Set a $wgHooks handler for a given hook and remove all other handlers (though not ones set via Hooks::register). More... | |
setTriggers ( $triggers) | |
@covers CaptchaPreAuthenticationProvider @group Database
Definition at line 11 of file CaptchaPreAuthenticationProviderTest.php.
|
protected |
Definition at line 276 of file CaptchaPreAuthenticationProviderTest.php.
|
protected |
Definition at line 281 of file CaptchaPreAuthenticationProviderTest.php.
References RequestContext\getMain().
|
protected |
Definition at line 269 of file CaptchaPreAuthenticationProviderTest.php.
Referenced by providePingLimiter(), provideTestForAccountCreation(), and provideTestForAuthentication().
CaptchaPreAuthenticationProviderTest::provideGetAuthenticationRequests | ( | ) |
Definition at line 64 of file CaptchaPreAuthenticationProviderTest.php.
References true.
CaptchaPreAuthenticationProviderTest::providePingLimiter | ( | ) |
Definition at line 246 of file CaptchaPreAuthenticationProviderTest.php.
References getCaptchaRequest(), User\newFromName(), and true.
CaptchaPreAuthenticationProviderTest::provideTestForAccountCreation | ( | ) |
Definition at line 158 of file CaptchaPreAuthenticationProviderTest.php.
References getCaptchaRequest(), User\newFromName(), and true.
CaptchaPreAuthenticationProviderTest::provideTestForAuthentication | ( | ) |
Definition at line 125 of file CaptchaPreAuthenticationProviderTest.php.
References $fallback, getCaptchaRequest(), and true.
|
protected |
Set a $wgHooks handler for a given hook and remove all other handlers (though not ones set via Hooks::register).
The original state will be restored after the test.
string | $hook | Hook name |
callable | $callback | Hook method |
Definition at line 301 of file CaptchaPreAuthenticationProviderTest.php.
Referenced by testPingLimiter(), testTestForAccountCreation(), and testTestForAuthentication().
|
protected |
Definition at line 286 of file CaptchaPreAuthenticationProviderTest.php.
References $type.
Referenced by testGetAuthenticationRequests(), testGetAuthenticationRequests_store(), testPostAuthentication(), testPostAuthentication_disabled(), and testTestForAccountCreation().
CaptchaPreAuthenticationProviderTest::setUp | ( | ) |
Definition at line 12 of file CaptchaPreAuthenticationProviderTest.php.
References ObjectCache\$instances, CaptchaStore\get(), and CaptchaStore\unsetInstanceForTests().
CaptchaPreAuthenticationProviderTest::tearDown | ( | ) |
Definition at line 31 of file CaptchaPreAuthenticationProviderTest.php.
CaptchaPreAuthenticationProviderTest::testGetAuthenticationRequests | ( | $action, | |
$username, | |||
$triggers, | |||
$needsCaptcha, | |||
$preTestCallback = null |
|||
) |
@dataProvider provideGetAuthenticationRequests
Definition at line 40 of file CaptchaPreAuthenticationProviderTest.php.
References RequestContext\getMain(), and setTriggers().
CaptchaPreAuthenticationProviderTest::testGetAuthenticationRequests_store | ( | ) |
Definition at line 82 of file CaptchaPreAuthenticationProviderTest.php.
References setTriggers().
CaptchaPreAuthenticationProviderTest::testPingLimiter | ( | array | $attempts | ) |
@dataProvider providePingLimiter
Definition at line 215 of file CaptchaPreAuthenticationProviderTest.php.
References $success, CaptchaStore\get(), and setMwHook().
CaptchaPreAuthenticationProviderTest::testPostAuthentication | ( | ) |
Definition at line 172 of file CaptchaPreAuthenticationProviderTest.php.
References User\newFromName(), setTriggers(), and wfMessage().
CaptchaPreAuthenticationProviderTest::testPostAuthentication_disabled | ( | ) |
Definition at line 195 of file CaptchaPreAuthenticationProviderTest.php.
References User\newFromName(), setTriggers(), and wfMessage().
CaptchaPreAuthenticationProviderTest::testTestForAccountCreation | ( | $req, | |
$creator, | |||
$result, | |||
$disableTrigger = false |
|||
) |
@dataProvider provideTestForAccountCreation
Definition at line 143 of file CaptchaPreAuthenticationProviderTest.php.
References $status, CaptchaStore\get(), User\newFromName(), setMwHook(), and setTriggers().
CaptchaPreAuthenticationProviderTest::testTestForAuthentication | ( | $req, | |
$isBadLoginTriggered, | |||
$isBadLoginPerUserTriggered, | |||
$result | |||
) |
@dataProvider provideTestForAuthentication
Definition at line 102 of file CaptchaPreAuthenticationProviderTest.php.
References $status, CaptchaStore\get(), and setMwHook().