Add basic tests for ULS' ResourceLoader modules
This is a starting point to increase the test coverage in this code base. Change-Id: I215713e928e9b55615afd17ccf7a7082ef559e01
This commit is contained in:
committed by
jenkins-bot
parent
f97a4df3bc
commit
24559cd1af
29
tests/phpunit/ResourceLoaderULSModuleTest.php
Normal file
29
tests/phpunit/ResourceLoaderULSModuleTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace UniversalLanguageSelector\Tests;
|
||||
|
||||
use ResourceLoaderULSModule;
|
||||
|
||||
/**
|
||||
* @covers \ResourceLoaderULSModule
|
||||
*
|
||||
* @license GPL-2.0-or-later
|
||||
* @author Thiemo Kreuz
|
||||
*/
|
||||
class ResourceLoaderULSModuleTest extends \PHPUnit\Framework\TestCase {
|
||||
use \PHPUnit4And6Compat;
|
||||
|
||||
public function testAllReturnValues() {
|
||||
$instance = new ResourceLoaderULSModule();
|
||||
|
||||
$context = $this->createMock( \ResourceLoaderContext::class );
|
||||
$context->method( 'getLanguage' )
|
||||
->willReturn( 'en' );
|
||||
|
||||
$script = $instance->getScript( $context );
|
||||
$this->assertStringStartsWith( 'mw.config.set({"wgULSLanguages":{"', $script );
|
||||
|
||||
$this->assertTrue( $instance->enableModuleContentVersion() );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user