2013-03-04 20:00:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Scribunto_LuaTextLibraryTests extends Scribunto_LuaEngineTestBase {
|
|
|
|
protected static $moduleName = 'TextLibraryTests';
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function setUp() {
|
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();
|
|
|
|
$markers = array(
|
|
|
|
'nowiki' => $parser->uniqPrefix() . '-test-nowiki-' . Parser::MARKER_SUFFIX,
|
|
|
|
'general' => $parser->uniqPrefix() . '-test-general-' . Parser::MARKER_SUFFIX,
|
|
|
|
);
|
|
|
|
$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() {
|
2013-03-04 20:00:59 +00:00
|
|
|
return parent::getTestModules() + array(
|
|
|
|
'TextLibraryTests' => __DIR__ . '/TextLibraryTests.lua',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|