Replaces \TestingAccessWrapper (defined in core) with \Wikimedia\TestingAccessWrapper (defined in the composer package wikimedia/testing-access-wrapper). See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper for downstream patches. The core version of the class is kept around for a while to avoid circular dependency problems. Bug: T163434 Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
30 lines
974 B
PHP
30 lines
974 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Auth;
|
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
/**
|
|
* @group AuthManager
|
|
* @covers MediaWiki\Auth\AbstractAuthenticationProvider
|
|
*/
|
|
class AbstractAuthenticationProviderTest extends \MediaWikiTestCase {
|
|
public function testAbstractAuthenticationProvider() {
|
|
$provider = $this->getMockForAbstractClass( AbstractAuthenticationProvider::class );
|
|
$providerPriv = TestingAccessWrapper::newFromObject( $provider );
|
|
|
|
$obj = $this->getMockForAbstractClass( 'Psr\Log\LoggerInterface' );
|
|
$provider->setLogger( $obj );
|
|
$this->assertSame( $obj, $providerPriv->logger, 'setLogger' );
|
|
|
|
$obj = AuthManager::singleton();
|
|
$provider->setManager( $obj );
|
|
$this->assertSame( $obj, $providerPriv->manager, 'setManager' );
|
|
|
|
$obj = $this->getMockForAbstractClass( 'Config' );
|
|
$provider->setConfig( $obj );
|
|
$this->assertSame( $obj, $providerPriv->config, 'setConfig' );
|
|
|
|
$this->assertType( 'string', $provider->getUniqueId(), 'getUniqueId' );
|
|
}
|
|
}
|