}
if ( isset( $info['AutoloadNamespaces'] ) ) {
$autoloadNamespaces += $this->processAutoLoader( $dir, $info['AutoloadNamespaces'] );
+ AutoLoader::$psr4Namespaces += $autoloadNamespaces;
}
// get all requirements/dependencies for this extension
--- /dev/null
+{
+ "manifest_version": 2,
+ "name": "WithAutoloadNamespaces",
+ "AutoloadNamespaces": {
+ "Test\\MediaWiki\\AutoLoader\\": "../autoloader/psr4/"
+ }
+}
] );
}
+ public function testReadFromQueueInitializeAutoloaderWithPsr4Namespaces() {
+ $registry = new ExtensionRegistry();
+ $registry->readFromQueue( [
+ "{$this->dataDir}/autoload_namespaces.json" => 1
+ ] );
+ $this->assertTrue(
+ class_exists( 'Test\\MediaWiki\\AutoLoader\\TestFooBar' ),
+ "Registry initializes Autoloader from AutoloadNamespaces"
+ );
+ }
+
/**
* @dataProvider provideExportExtractedDataGlobals
*/