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
|
|
|
|
2023-05-05 06:10:57 +00:00
|
|
|
use MediaWiki\Extension\CodeMirror\DataScript;
|
2022-05-20 02:11:31 +00:00
|
|
|
use MediaWiki\ResourceLoader\Context;
|
2020-10-08 08:18:20 +00:00
|
|
|
|
|
|
|
/**
|
2023-05-05 06:10:57 +00:00
|
|
|
* @covers \MediaWiki\Extension\CodeMirror\DataScript
|
2020-10-08 08:18:20 +00:00
|
|
|
*/
|
2023-05-05 06:10:57 +00:00
|
|
|
class DataScriptTest extends \MediaWikiIntegrationTestCase {
|
2020-10-08 08:18:20 +00:00
|
|
|
|
2023-05-05 06:10:57 +00:00
|
|
|
public function testMakeScript() {
|
2022-05-20 02:11:31 +00:00
|
|
|
$context = $this->createMock( Context::class );
|
2020-10-08 08:18:20 +00:00
|
|
|
|
2023-05-05 06:10:57 +00:00
|
|
|
$script = DataScript::makeScript( $context );
|
2020-10-08 08:18:20 +00:00
|
|
|
$this->assertStringContainsString( '"extCodeMirrorConfig":', $script );
|
2024-06-08 03:10:11 +00:00
|
|
|
$this->assertStringContainsString( '"lineNumberingNamespaces":', $script );
|
|
|
|
$this->assertStringContainsString( '"templateFoldingNamespaces":', $script );
|
|
|
|
$this->assertStringContainsString( '"isSupportedRtlWiki":', $script );
|
2020-10-08 08:18:20 +00:00
|
|
|
$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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|