mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-23 15:56:55 +00:00
Remove Database group again where possible
Override the target language in the parser options, so that it isn’t looked up from the database; this lets UriLibraryTest avoid database access. And since the Database group is no longer strictly required, remove the statement to that effect from the phpdoc again. Bug: T345372 Change-Id: I79f35257b123eb939d9ab67b16aa56d34586bb67
This commit is contained in:
parent
7e54c088ac
commit
b39d3589ba
|
@ -16,8 +16,6 @@ use PHPUnit\Framework\TestSuite;
|
|||
* - $moduleName: Name of the module being tested
|
||||
* - getTestModules(): Add a mapping from $moduleName to the file containing
|
||||
* the code.
|
||||
*
|
||||
* Also, your test must be in the Database group.
|
||||
*/
|
||||
abstract class LuaEngineTestBase extends MediaWikiLangTestCase {
|
||||
use LuaEngineTestHelper;
|
||||
|
|
|
@ -143,9 +143,11 @@ trait LuaEngineTestHelper {
|
|||
*/
|
||||
protected function getEngine() {
|
||||
if ( !$this->engine ) {
|
||||
$parser = MediaWikiServices::getInstance()->getParserFactory()->create();
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$parser = $services->getParserFactory()->create();
|
||||
$options = ParserOptions::newFromAnon();
|
||||
$options->setTemplateCallback( [ $this, 'templateCallback' ] );
|
||||
$options->setTargetLanguage( $services->getLanguageFactory()->getLanguage( 'en' ) );
|
||||
$parser->startExternalParse( $this->getTestTitle(), $options, Parser::OT_HTML, true );
|
||||
|
||||
// HACK
|
||||
|
|
|
@ -4,8 +4,6 @@ namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
|
|||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Scribunto\Engines\LuaCommon\UriLibrary
|
||||
*
|
||||
* @group Database
|
||||
*/
|
||||
class UriLibraryTest extends LuaEngineTestBase {
|
||||
/** @inheritDoc */
|
||||
|
|
Loading…
Reference in a new issue