mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-18 08:40:33 +00:00
386bb03b01
Change-Id: I83913927e86d44726d3a1c3a682cc1f6e2372f07
32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\CodeMirror\Tests;
|
|
|
|
use MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule;
|
|
use ResourceLoaderContext;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule
|
|
*/
|
|
class ResourceLoaderCodeMirrorModuleTest extends \MediaWikiIntegrationTestCase {
|
|
|
|
public function testResourceLoaderModule() {
|
|
$context = $this->createMock( ResourceLoaderContext::class );
|
|
$module = new ResourceLoaderCodeMirrorModule();
|
|
|
|
$this->assertFalse( $module->supportsURLLoading() );
|
|
$this->assertTrue( $module->enableModuleContentVersion() );
|
|
|
|
$script = $module->getScript( $context );
|
|
$this->assertStringContainsString( '"extCodeMirrorConfig":', $script );
|
|
$this->assertStringContainsString( '"pluginModules":', $script );
|
|
$this->assertStringContainsString( '"tagModes":', $script );
|
|
$this->assertStringContainsString( '"tags":', $script );
|
|
$this->assertStringContainsString( '"doubleUnderscore":', $script );
|
|
$this->assertStringContainsString( '"functionSynonyms":', $script );
|
|
$this->assertStringContainsString( '"urlProtocols":', $script );
|
|
$this->assertStringContainsString( '"linkTrailCharacters":', $script );
|
|
}
|
|
|
|
}
|