3 namespace MediaWiki\Auth
;
7 * @covers MediaWiki\Auth\AbstractAuthenticationProvider
9 class AbstractAuthenticationProviderTest
extends \MediaWikiTestCase
{
10 protected function setUp() {
11 global $wgDisableAuthManager;
14 if ( $wgDisableAuthManager ) {
15 $this->markTestSkipped( '$wgDisableAuthManager is set' );
19 public function testAbstractAuthenticationProvider() {
20 $provider = $this->getMockForAbstractClass( AbstractAuthenticationProvider
::class );
21 $providerPriv = \TestingAccessWrapper
::newFromObject( $provider );
23 $obj = $this->getMockForAbstractClass( 'Psr\Log\LoggerInterface' );
24 $provider->setLogger( $obj );
25 $this->assertSame( $obj, $providerPriv->logger
, 'setLogger' );
27 $obj = AuthManager
::singleton();
28 $provider->setManager( $obj );
29 $this->assertSame( $obj, $providerPriv->manager
, 'setManager' );
31 $obj = $this->getMockForAbstractClass( 'Config' );
32 $provider->setConfig( $obj );
33 $this->assertSame( $obj, $providerPriv->config
, 'setConfig' );
35 $this->assertType( 'string', $provider->getUniqueId(), 'getUniqueId' );