MediaWiki REL1_34
CaptchaPreAuthenticationProviderTest Class Reference

@covers CaptchaPreAuthenticationProvider @group Database More...

Inheritance diagram for CaptchaPreAuthenticationProviderTest:
Collaboration diagram for CaptchaPreAuthenticationProviderTest:

Public Member Functions

 provideGetAuthenticationRequests ()
 
 providePingLimiter ()
 
 provideTestForAccountCreation ()
 
 provideTestForAuthentication ()
 
 setUp ()
 
 tearDown ()
 
 testGetAuthenticationRequests ( $action, $username, $triggers, $needsCaptcha, $preTestCallback=null)
 @dataProvider provideGetAuthenticationRequests
 
 testGetAuthenticationRequests_store ()
 
 testPingLimiter (array $attempts)
 @dataProvider providePingLimiter
 
 testPostAuthentication ()
 
 testPostAuthentication_disabled ()
 
 testTestForAccountCreation ( $req, $creator, $result, $disableTrigger=false)
 @dataProvider provideTestForAccountCreation
 
 testTestForAuthentication ( $req, $isBadLoginTriggered, $isBadLoginPerUserTriggered, $result)
 @dataProvider provideTestForAuthentication
 

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).
 
 setTriggers ( $triggers)
 

Detailed Description

@covers CaptchaPreAuthenticationProvider @group Database

Definition at line 11 of file CaptchaPreAuthenticationProviderTest.php.

Member Function Documentation

◆ blockLogin()

CaptchaPreAuthenticationProviderTest::blockLogin ( $username)
protected

Definition at line 276 of file CaptchaPreAuthenticationProviderTest.php.

◆ flagSession()

CaptchaPreAuthenticationProviderTest::flagSession ( )
protected

Definition at line 281 of file CaptchaPreAuthenticationProviderTest.php.

◆ getCaptchaRequest()

CaptchaPreAuthenticationProviderTest::getCaptchaRequest ( $id,
$word,
$username = null )
protected

◆ provideGetAuthenticationRequests()

CaptchaPreAuthenticationProviderTest::provideGetAuthenticationRequests ( )

Definition at line 64 of file CaptchaPreAuthenticationProviderTest.php.

References true.

◆ providePingLimiter()

CaptchaPreAuthenticationProviderTest::providePingLimiter ( )

Definition at line 246 of file CaptchaPreAuthenticationProviderTest.php.

References getCaptchaRequest(), and true.

◆ provideTestForAccountCreation()

CaptchaPreAuthenticationProviderTest::provideTestForAccountCreation ( )

Definition at line 158 of file CaptchaPreAuthenticationProviderTest.php.

References getCaptchaRequest(), and true.

◆ provideTestForAuthentication()

CaptchaPreAuthenticationProviderTest::provideTestForAuthentication ( )

Definition at line 125 of file CaptchaPreAuthenticationProviderTest.php.

References $fallback, getCaptchaRequest(), and true.

◆ setMwHook()

CaptchaPreAuthenticationProviderTest::setMwHook ( $hook,
callable $callback )
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.

Parameters
string$hookHook name
callable$callbackHook method

Definition at line 301 of file CaptchaPreAuthenticationProviderTest.php.

Referenced by testPingLimiter(), testTestForAccountCreation(), and testTestForAuthentication().

◆ setTriggers()

CaptchaPreAuthenticationProviderTest::setTriggers ( $triggers)
protected

◆ setUp()

CaptchaPreAuthenticationProviderTest::setUp ( )

◆ tearDown()

CaptchaPreAuthenticationProviderTest::tearDown ( )

Definition at line 31 of file CaptchaPreAuthenticationProviderTest.php.

◆ testGetAuthenticationRequests()

CaptchaPreAuthenticationProviderTest::testGetAuthenticationRequests ( $action,
$username,
$triggers,
$needsCaptcha,
$preTestCallback = null )

@dataProvider provideGetAuthenticationRequests

Definition at line 40 of file CaptchaPreAuthenticationProviderTest.php.

References setTriggers().

◆ testGetAuthenticationRequests_store()

CaptchaPreAuthenticationProviderTest::testGetAuthenticationRequests_store ( )

Definition at line 82 of file CaptchaPreAuthenticationProviderTest.php.

References setTriggers().

◆ testPingLimiter()

CaptchaPreAuthenticationProviderTest::testPingLimiter ( array $attempts)

@dataProvider providePingLimiter

Definition at line 215 of file CaptchaPreAuthenticationProviderTest.php.

References $success, CaptchaStore\get(), and setMwHook().

◆ testPostAuthentication()

CaptchaPreAuthenticationProviderTest::testPostAuthentication ( )

Definition at line 172 of file CaptchaPreAuthenticationProviderTest.php.

References setTriggers(), and wfMessage().

◆ testPostAuthentication_disabled()

CaptchaPreAuthenticationProviderTest::testPostAuthentication_disabled ( )

Definition at line 195 of file CaptchaPreAuthenticationProviderTest.php.

References setTriggers(), and wfMessage().

◆ testTestForAccountCreation()

CaptchaPreAuthenticationProviderTest::testTestForAccountCreation ( $req,
$creator,
$result,
$disableTrigger = false )

@dataProvider provideTestForAccountCreation

Definition at line 143 of file CaptchaPreAuthenticationProviderTest.php.

References CaptchaStore\get(), setMwHook(), and setTriggers().

◆ testTestForAuthentication()

CaptchaPreAuthenticationProviderTest::testTestForAuthentication ( $req,
$isBadLoginTriggered,
$isBadLoginPerUserTriggered,
$result )

@dataProvider provideTestForAuthentication

Definition at line 102 of file CaptchaPreAuthenticationProviderTest.php.

References CaptchaStore\get(), and setMwHook().


The documentation for this class was generated from the following file: