Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
CentralAuthSharedDomainPreAuthenticationProvider
0.00% covered (danger)
0.00%
0 / 5
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
 testForAuthentication
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 testForAccountCreation
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\CentralAuth;
4
5use MediaWiki\Auth\AbstractPreAuthenticationProvider;
6use MediaWiki\Extension\CentralAuth\Hooks\Handlers\SharedDomainHookHandler;
7use StatusValue;
8
9/**
10 * Helper for SharedDomainHookHandler to persist state across multiple authentication requests.
11 *
12 * @see SharedDomainHookHandler::onAuthManagerVerifyAuthentication()
13 */
14class CentralAuthSharedDomainPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
15
16    private FilteredRequestTracker $filteredRequestTracker;
17
18    public function __construct(
19        FilteredRequestTracker $filteredRequestTracker
20    ) {
21        $this->filteredRequestTracker = $filteredRequestTracker;
22    }
23
24    /** @inheritDoc */
25    public function testForAuthentication( array $reqs ) {
26        $this->filteredRequestTracker->saveState( $this->manager );
27        return StatusValue::newGood();
28    }
29
30    /** @inheritDoc */
31    public function testForAccountCreation( $user, $creator, array $reqs ) {
32        $this->filteredRequestTracker->saveState( $this->manager );
33        return StatusValue::newGood();
34    }
35
36}