2013-03-04 20:00:59 +00:00
|
|
|
<?php
|
|
|
|
|
2018-03-10 13:15:42 +00:00
|
|
|
class Scribunto_LuaTextLibraryTest extends Scribunto_LuaEngineTestBase {
|
2013-03-04 20:00:59 +00:00
|
|
|
protected static $moduleName = 'TextLibraryTests';
|
|
|
|
|
2016-05-17 14:52:05 +00:00
|
|
|
public function __construct(
|
2017-06-15 17:19:00 +00:00
|
|
|
$name = null, array $data = [], $dataName = '', $engineName = null
|
2016-05-17 14:52:05 +00:00
|
|
|
) {
|
|
|
|
parent::__construct( $name, $data, $dataName, $engineName );
|
2015-11-11 22:51:56 +00:00
|
|
|
if ( defined( 'HHVM_VERSION' ) ) {
|
|
|
|
// HHVM bug https://github.com/facebook/hhvm/issues/5813
|
2015-11-11 20:46:29 +00:00
|
|
|
$this->skipTests['json decode, invalid values (trailing comma)'] =
|
|
|
|
'json decode bug in HHVM';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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();
|
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
|
|
|
}
|
|
|
|
}
|