mediawiki-extensions-Confir.../tests/phpunit/QuestyCaptchaTest.php
Reedy a801949300 Remove class_alias calls and cleanup Autoloads
Existed since 1.39 in I3fa9747e0ea970c5de39e2da8603e1bba9388a69

Change-Id: I17a648aaf7644d00cd82966a88dab8f33d2e317f
2024-10-30 01:48:14 +00:00

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!',
],
]
];
}
}