2020-10-08 08:18:20 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-06 15:13:05 +00:00
|
|
|
namespace MediaWiki\Extension\CodeMirror\Tests;
|
2020-10-08 08:18:20 +00:00
|
|
|
|
2022-02-06 15:13:05 +00:00
|
|
|
use MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule;
|
2022-05-20 02:11:31 +00:00
|
|
|
use MediaWiki\ResourceLoader\Context;
|
2020-10-08 08:18:20 +00:00
|
|
|
|
|
|
|
/**
|
2022-02-06 15:13:05 +00:00
|
|
|
* @covers \MediaWiki\Extension\CodeMirror\ResourceLoaderCodeMirrorModule
|
2020-10-08 08:18:20 +00:00
|
|
|
*/
|
|
|
|
class ResourceLoaderCodeMirrorModuleTest extends \MediaWikiIntegrationTestCase {
|
|
|
|
|
|
|
|
public function testResourceLoaderModule() {
|
2022-05-20 02:11:31 +00:00
|
|
|
$context = $this->createMock( Context::class );
|
2020-10-08 08:18:20 +00:00
|
|
|
$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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|