mediawiki-extensions-Confir.../tests/phpunit/QuestyCaptchaTest.php
Reedy 48a60aa762 Various minor code cleanup
Change-Id: I75f34c66f1c1968cfb9a3e1932068ec2420e0fa6
2024-10-30 01:48:33 +00:00

46 lines
825 B
PHP

<?php
use MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha;
/**
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha
*/
class QuestyCaptchaTest extends MediaWikiIntegrationTestCase {
/**
* @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!',
],
]
];
}
}