* @group Database */ class OATHAuthModuleRegistryTest extends MediaWikiIntegrationTestCase { /** @var string[] */ protected $tablesUsed = [ 'oathauth_types' ]; /** * @covers \MediaWiki\Extension\OATHAuth\OATHAuthModuleRegistry::getModuleIds */ public function testGetModuleIds() { $this->db->insert( 'oathauth_types', [ 'oat_name' => 'first' ], __METHOD__ ); $database = $this->createMock( OATHAuthDatabase::class ); $database->method( 'getDB' )->willReturn( $this->db ); $registry = new OATHAuthModuleRegistry( $database, [ 'first' => 'does not matter', 'second' => 'does not matter', 'third' => 'does not matter', ] ); $this->assertEquals( [ 'first', 'second', 'third' ], array_keys( $registry->getModuleIds() ) ); } }