Merge "Disable Cucumber scenarios that are broken in daily Jenkins jobs"
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / AbstractAuthenticationProviderTest.php
1 <?php
2
3 namespace MediaWiki\Auth;
4
5 /**
6 * @group AuthManager
7 * @covers MediaWiki\Auth\AbstractAuthenticationProvider
8 */
9 class AbstractAuthenticationProviderTest extends \MediaWikiTestCase {
10 protected function setUp() {
11 global $wgDisableAuthManager;
12
13 parent::setUp();
14 if ( $wgDisableAuthManager ) {
15 $this->markTestSkipped( '$wgDisableAuthManager is set' );
16 }
17 }
18
19 public function testAbstractAuthenticationProvider() {
20 $provider = $this->getMockForAbstractClass( AbstractAuthenticationProvider::class );
21 $providerPriv = \TestingAccessWrapper::newFromObject( $provider );
22
23 $obj = $this->getMockForAbstractClass( 'Psr\Log\LoggerInterface' );
24 $provider->setLogger( $obj );
25 $this->assertSame( $obj, $providerPriv->logger, 'setLogger' );
26
27 $obj = AuthManager::singleton();
28 $provider->setManager( $obj );
29 $this->assertSame( $obj, $providerPriv->manager, 'setManager' );
30
31 $obj = $this->getMockForAbstractClass( 'Config' );
32 $provider->setConfig( $obj );
33 $this->assertSame( $obj, $providerPriv->config, 'setConfig' );
34
35 $this->assertType( 'string', $provider->getUniqueId(), 'getUniqueId' );
36 }
37 }