mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-12 08:25:10 +00:00
96da9fe0e9
The replacement, Parser::getStripState(), was added to MediaWiki in 1.34. The extension.json for this extension already requires MW >= 1.35. Bug: T275160 Change-Id: I062ac8b69756a7ad35d8cc744b4735fd2e70f13e
31 lines
930 B
PHP
31 lines
930 B
PHP
<?php
|
|
|
|
class Scribunto_LuaTextLibraryTest extends Scribunto_LuaEngineUnitTestBase {
|
|
/** @inheritDoc */
|
|
protected static $moduleName = 'TextLibraryTests';
|
|
|
|
protected function setUp() : void {
|
|
parent::setUp();
|
|
|
|
// For unstrip test
|
|
$parser = $this->getEngine()->getParser();
|
|
$markers = [
|
|
'nowiki' => Parser::MARKER_PREFIX . '-test-nowiki-' . Parser::MARKER_SUFFIX,
|
|
'general' => Parser::MARKER_PREFIX . '-test-general-' . Parser::MARKER_SUFFIX,
|
|
];
|
|
$parser->getStripState()->addNoWiki( $markers['nowiki'], 'NoWiki' );
|
|
$parser->getStripState()->addGeneral( $markers['general'], 'General' );
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
$interpreter->callFunction(
|
|
$interpreter->loadString( 'mw.text.stripTest = ...', 'fortest' ),
|
|
$markers
|
|
);
|
|
}
|
|
|
|
protected function getTestModules() {
|
|
return parent::getTestModules() + [
|
|
'TextLibraryTests' => __DIR__ . '/TextLibraryTests.lua',
|
|
];
|
|
}
|
|
}
|