mediawiki-extensions-CodeMi.../tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php
Reedy 386bb03b01 Namespace extension
Change-Id: I83913927e86d44726d3a1c3a682cc1f6e2372f07
2022-02-06 15:16:42 +00:00

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 );
}
}