mediawiki-extensions-CodeMi.../tests/phpunit/ResourceLoaderCodeMirrorModuleTest.php
Thiemo Kreuz ff1c26e877 Add missing PHPUnit tests for better coverage
Change-Id: I242aa52a24a11de3db106e5e2c73bd6f2a95d80c
2020-10-08 10:18:45 +02:00

32 lines
1.1 KiB
PHP

<?php
namespace CodeMirror\Tests;
use ResourceLoaderCodeMirrorModule;
use ResourceLoaderContext;
/**
* @covers \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 );
}
}