Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
TurnstileAuthenticationRequest
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 loadFromSubmission
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getFieldInfo
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\ConfirmEdit\Turnstile;
4
5use MediaWiki\Auth\AuthenticationRequest;
6use MediaWiki\Extension\ConfirmEdit\Auth\CaptchaAuthenticationRequest;
7
8/**
9 * Authentication request for Turnstile. Functions almost identically to ReCaptchaNoCaptchaAuthenticationRequest.
10 */
11class TurnstileAuthenticationRequest extends CaptchaAuthenticationRequest {
12    public function __construct() {
13        parent::__construct( '', [] );
14    }
15
16    /** @inheritDoc */
17    public function loadFromSubmission( array $data ) {
18        // unhack the hack in parent
19        return AuthenticationRequest::loadFromSubmission( $data );
20    }
21
22    /** @inheritDoc */
23    public function getFieldInfo() {
24        $fieldInfo = parent::getFieldInfo();
25
26        return [
27            'captchaWord' => [
28                'type' => 'string',
29                'label' => $fieldInfo['captchaInfo']['label'],
30                'help' => wfMessage( 'turnstile-help' ),
31            ],
32        ];
33    }
34}