2013-03-04 20:00:59 +00:00
|
|
|
<?php
|
|
|
|
|
2019-08-03 18:19:46 +00:00
|
|
|
class Scribunto_LuaTextLibraryTest extends Scribunto_LuaEngineUnitTestBase {
|
2013-03-04 20:00:59 +00:00
|
|
|
protected static $moduleName = 'TextLibraryTests';
|
|
|
|
|
2019-10-11 18:31:29 +00:00
|
|
|
protected function setUp() : void {
|
2013-03-04 20:00:59 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
// For unstrip test
|
2014-11-05 17:18:22 +00:00
|
|
|
$parser = $this->getEngine()->getParser();
|
2017-06-15 17:19:00 +00:00
|
|
|
$markers = [
|
2015-06-16 14:22:10 +00:00
|
|
|
'nowiki' => Parser::MARKER_PREFIX . '-test-nowiki-' . Parser::MARKER_SUFFIX,
|
|
|
|
'general' => Parser::MARKER_PREFIX . '-test-general-' . Parser::MARKER_SUFFIX,
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2014-11-05 17:18:22 +00:00
|
|
|
$parser->mStripState->addNoWiki( $markers['nowiki'], 'NoWiki' );
|
|
|
|
$parser->mStripState->addGeneral( $markers['general'], 'General' );
|
2013-03-04 20:00:59 +00:00
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
|
|
$interpreter->callFunction(
|
|
|
|
$interpreter->loadString( 'mw.text.stripTest = ...', 'fortest' ),
|
2014-11-05 17:18:22 +00:00
|
|
|
$markers
|
2013-03-04 20:00:59 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function getTestModules() {
|
2017-06-15 17:19:00 +00:00
|
|
|
return parent::getTestModules() + [
|
2013-03-04 20:00:59 +00:00
|
|
|
'TextLibraryTests' => __DIR__ . '/TextLibraryTests.lua',
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2013-03-04 20:00:59 +00:00
|
|
|
}
|
|
|
|
}
|