mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-27 15:40:00 +00:00
Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due to T308443. Bug: T308718 Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659 Change-Id: I47dad71df97f38c55550f71baf6dae67dbe0a2ba
This commit is contained in:
parent
1310fbf645
commit
3a0c4b1f3e
|
@ -24,18 +24,17 @@ namespace MediaWiki\Extension\CodeMirror;
|
||||||
|
|
||||||
use ExtensionRegistry;
|
use ExtensionRegistry;
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
use ResourceLoader;
|
use MediaWiki\ResourceLoader as RL;
|
||||||
use ResourceLoaderContext;
|
use MediaWiki\ResourceLoader\ResourceLoader;
|
||||||
use ResourceLoaderFileModule;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResourceLoader module for ext.CodeMirror
|
* ResourceLoader module for ext.CodeMirror
|
||||||
*/
|
*/
|
||||||
class ResourceLoaderCodeMirrorModule extends ResourceLoaderFileModule {
|
class ResourceLoaderCodeMirrorModule extends RL\FileModule {
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function getScript( ResourceLoaderContext $context ) {
|
public function getScript( RL\Context $context ) {
|
||||||
return ResourceLoader::makeConfigSetScript(
|
return ResourceLoader::makeConfigSetScript(
|
||||||
[ 'extCodeMirrorConfig' => $this->getFrontendConfiguraton() ]
|
[ 'extCodeMirrorConfig' => $this->getFrontendConfiguraton() ]
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace MediaWiki\Extension\CodeMirror\Tests;
|
namespace MediaWiki\Extension\CodeMirror\Tests;
|
||||||
|
|
||||||
use MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule;
|
use MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule;
|
||||||
use ResourceLoaderContext;
|
use MediaWiki\ResourceLoader\Context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers \MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule
|
* @covers \MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule
|
||||||
|
@ -11,7 +11,7 @@ use ResourceLoaderContext;
|
||||||
class ResourceLoaderCodeMirrorModuleTest extends \MediaWikiIntegrationTestCase {
|
class ResourceLoaderCodeMirrorModuleTest extends \MediaWikiIntegrationTestCase {
|
||||||
|
|
||||||
public function testResourceLoaderModule() {
|
public function testResourceLoaderModule() {
|
||||||
$context = $this->createMock( ResourceLoaderContext::class );
|
$context = $this->createMock( Context::class );
|
||||||
$module = new ResourceLoaderCodeMirrorModule();
|
$module = new ResourceLoaderCodeMirrorModule();
|
||||||
|
|
||||||
$this->assertFalse( $module->supportsURLLoading() );
|
$this->assertFalse( $module->supportsURLLoading() );
|
||||||
|
|
Loading…
Reference in a new issue