wiki.techinc.nl/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php
Gergő Tisza 525bfbc8df Switch to librarized version of TestingAccessWrapper
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
2017-04-20 14:15:57 +00:00

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' );
}
}