]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / phpunit / includes / auth / AbstractAuthenticationProviderTest.php
diff --git a/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php b/tests/phpunit/includes/auth/AbstractAuthenticationProviderTest.php
new file mode 100644 (file)
index 0000000..a3b0df5
--- /dev/null
@@ -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' );
+               $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' );
+       }
+}