2013-12-16 15:00:37 +00:00
|
|
|
<?php
|
|
|
|
|
2022-07-30 22:43:58 +00:00
|
|
|
namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
|
|
|
|
|
2024-06-10 18:41:33 +00:00
|
|
|
use MediaWiki\Parser\Parser;
|
2022-07-30 22:43:58 +00:00
|
|
|
|
2022-10-08 19:51:24 +00:00
|
|
|
/**
|
|
|
|
* @covers \MediaWiki\Extension\Scribunto\Engines\LuaCommon\HtmlLibrary
|
|
|
|
*/
|
2022-08-03 12:31:15 +00:00
|
|
|
class HtmlLibraryTest extends LuaEngineUnitTestBase {
|
2021-01-23 01:33:17 +00:00
|
|
|
/** @inheritDoc */
|
2013-12-16 15:00:37 +00:00
|
|
|
protected static $moduleName = 'HtmlLibraryTests';
|
|
|
|
|
2021-07-23 10:49:13 +00:00
|
|
|
protected function setUp(): void {
|
2016-03-14 15:48:20 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
// For strip marker test
|
2017-06-15 17:19:00 +00:00
|
|
|
$markers = [
|
2016-03-14 15:48:20 +00:00
|
|
|
'nowiki' => Parser::MARKER_PREFIX . '-test-nowiki-' . Parser::MARKER_SUFFIX,
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2016-03-14 15:48:20 +00:00
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
|
|
$interpreter->callFunction(
|
|
|
|
$interpreter->loadString( 'mw.html.stripMarkers = ...', 'fortest' ),
|
|
|
|
$markers
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function getTestModules() {
|
2017-06-15 17:19:00 +00:00
|
|
|
return parent::getTestModules() + [
|
2013-12-16 15:00:37 +00:00
|
|
|
'HtmlLibraryTests' => __DIR__ . '/HtmlLibraryTests.lua',
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2013-12-16 15:00:37 +00:00
|
|
|
}
|
|
|
|
}
|