mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-18 00:30:30 +00:00
925775778a
Add new temporary ext.CodeMirror.visualEditor.init RL module which selects the temporary ext.CodeMirror.visualEditor.v6 or non-v6 based on $wgCodeMirrorV6. This will allow us to deploy CM6 further. As a result of this work, the core CodeMirror class now has knowledge of ve.ui.Surface. Other changes: * Add Compartment for specialCharsExtension so it can be disabled in VE. * Add option to mediaWikiLang() to disable template folding. * Add support for RTL wikis where $wgCodeMirrorRTL is enabled. * Make CodeMirror.logUsage() and setCodeMirrorPreference() static. * Fix unit and linting tests. Some code courtesy of Fandom, GPLv2-or-later; see: https://github.com/Wikia/mediawiki-extensions-CodeMirror/commit/ef297c48c Bug: T357482 Change-Id: I15453b33e77e1c1b4d5e5183e41e53d56ff14c3e
31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\CodeMirror\Tests;
|
|
|
|
use MediaWiki\Extension\CodeMirror\DataScript;
|
|
use MediaWiki\ResourceLoader\Context;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\CodeMirror\DataScript
|
|
*/
|
|
class DataScriptTest extends \MediaWikiIntegrationTestCase {
|
|
|
|
public function testMakeScript() {
|
|
$context = $this->createMock( Context::class );
|
|
|
|
$script = DataScript::makeScript( $context );
|
|
$this->assertStringContainsString( '"extCodeMirrorConfig":', $script );
|
|
$this->assertStringContainsString( '"lineNumberingNamespaces":', $script );
|
|
$this->assertStringContainsString( '"templateFoldingNamespaces":', $script );
|
|
$this->assertStringContainsString( '"isSupportedRtlWiki":', $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 );
|
|
}
|
|
|
|
}
|