Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1425903
CaptchaAuthenticationRequestTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CaptchaAuthenticationRequestTest.php
View Options
<?php
use
MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest
;
use
MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha
;
use
MediaWiki\Extension\ConfirmEdit\Store\CaptchaHashStore
;
use
MediaWiki\Extension\ConfirmEdit\Store\CaptchaStore
;
use
MediaWiki\Tests\Auth\AuthenticationRequestTestCase
;
/**
* @covers \MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest
*/
class
CaptchaAuthenticationRequestTest
extends
AuthenticationRequestTestCase
{
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
overrideConfigValues
(
[
'CaptchaClass'
=>
SimpleCaptcha
::
class
,
'CaptchaStorageClass'
=>
CaptchaHashStore
::
class
,
]
);
CaptchaStore
::
unsetInstanceForTests
();
CaptchaStore
::
get
()->
clearAll
();
CaptchaStore
::
get
()->
store
(
'345'
,
[
'question'
=>
'2+2'
,
'answer'
=>
'4'
]
);
}
protected
function
getInstance
(
array
$args
=
[]
)
{
return
new
CaptchaAuthenticationRequest
(
$args
[
0
],
$args
[
1
]
);
}
public
static
function
provideGetFieldInfo
()
{
return
[
[
[
'123'
,
[
'question'
=>
'1+2'
,
'answer'
=>
'3'
]
]
],
];
}
public
static
function
provideLoadFromSubmission
()
{
return
[
'no id'
=>
[
[
'123'
,
[
'question'
=>
'1+2'
,
'answer'
=>
'3'
]
],
[],
false
,
],
'no answer'
=>
[
[
'123'
,
[
'question'
=>
'1+2'
,
'answer'
=>
'3'
]
],
[
'captchaId'
=>
'345'
],
false
,
],
'missing'
=>
[
[
'123'
,
[
'question'
=>
'1+2'
,
'answer'
=>
'3'
]
],
[
'captchaId'
=>
'234'
,
'captchaWord'
=>
'5'
],
false
,
],
'normal'
=>
[
[
'123'
,
[
'question'
=>
'1+2'
,
'answer'
=>
'3'
]
],
[
'captchaId'
=>
'345'
,
'captchaWord'
=>
'5'
],
[
'captchaId'
=>
'345'
,
'captchaData'
=>
[
'question'
=>
'2+2'
,
'answer'
=>
'4'
],
'captchaWord'
=>
'5'
],
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 12:11 (23 h, 33 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
05/c2/c71412f3951e186fd94ac39c4b68
Default Alt Text
CaptchaAuthenticationRequestTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment