diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php |
first commit
Diffstat (limited to 'www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php')
-rw-r--r-- | www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php b/www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php new file mode 100644 index 00000000..b271b701 --- /dev/null +++ b/www/wiki/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php @@ -0,0 +1,30 @@ +<?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::class ); + $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::class ); + $provider->setConfig( $obj ); + $this->assertSame( $obj, $providerPriv->config, 'setConfig' ); + + $this->assertType( 'string', $provider->getUniqueId(), 'getUniqueId' ); + } +} |