mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-12 08:25:10 +00:00
29f4c03de1
composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 npm: * postcss: 7.0.35 → 7.0.36 * https://npmjs.com/advisories/1693 (CVE-2021-23368) * glob-parent: 5.1.0 → 5.1.2 * https://npmjs.com/advisories/1751 (CVE-2020-28469) * trim-newlines: 3.0.0 → 3.0.1 * https://npmjs.com/advisories/1753 (CVE-2021-33623) Change-Id: If0310d25d0380a6d4e936e666729e6a65a90a710
31 lines
929 B
PHP
31 lines
929 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',
|
|
];
|
|
}
|
|
}
|