mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
a801949300
Existed since 1.39 in I3fa9747e0ea970c5de39e2da8603e1bba9388a69 Change-Id: I17a648aaf7644d00cd82966a88dab8f33d2e317f
47 lines
910 B
PHP
47 lines
910 B
PHP
<?php
|
|
|
|
use MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha
|
|
*/
|
|
class QuestyCaptchaTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha::getCaptcha
|
|
* @dataProvider provideGetCaptcha
|
|
*/
|
|
public function testGetCaptcha( $config, $expected ) {
|
|
$this->overrideConfigValue( 'CaptchaQuestions', $config );
|
|
|
|
$qc = new QuestyCaptcha();
|
|
$this->assertEquals( $expected, $qc->getCaptcha() );
|
|
}
|
|
|
|
public static function provideGetCaptcha() {
|
|
return [
|
|
[
|
|
[
|
|
[
|
|
'question' => 'FooBar',
|
|
'answer' => 'Answer!',
|
|
],
|
|
],
|
|
[
|
|
'question' => 'FooBar',
|
|
'answer' => 'Answer!',
|
|
],
|
|
],
|
|
[
|
|
[
|
|
'FooBar' => 'Answer!',
|
|
],
|
|
[
|
|
'question' => 'FooBar',
|
|
'answer' => 'Answer!',
|
|
],
|
|
]
|
|
];
|
|
}
|
|
}
|