MediaWiki
REL1_34
TextLibraryTest.php
Go to the documentation of this file.
1
<?php
2
3
class
Scribunto_LuaTextLibraryTest
extends
Scribunto_LuaEngineUnitTestBase
{
4
protected
static
$moduleName
=
'TextLibraryTests'
;
5
6
public
function
__construct
(
7
$name =
null
, array $data = [], $dataName =
''
,
$engineName
=
null
8
) {
9
parent::__construct( $name, $data, $dataName,
$engineName
);
10
if
( defined(
'HHVM_VERSION'
) ) {
11
// HHVM bug https://github.com/facebook/hhvm/issues/5813
12
$this->skipTests[
'json decode, invalid values (trailing comma)'
] =
13
'json decode bug in HHVM'
;
14
}
15
}
16
17
protected
function
setUp
() {
18
parent::setUp();
19
20
// For unstrip test
21
$parser = $this->
getEngine
()->getParser();
22
$markers = [
23
'nowiki'
=> Parser::MARKER_PREFIX .
'-test-nowiki-'
. Parser::MARKER_SUFFIX,
24
'general'
=> Parser::MARKER_PREFIX .
'-test-general-'
. Parser::MARKER_SUFFIX,
25
];
26
$parser->mStripState->addNoWiki( $markers[
'nowiki'
],
'NoWiki'
);
27
$parser->mStripState->addGeneral( $markers[
'general'
],
'General'
);
28
$interpreter = $this->
getEngine
()->getInterpreter();
29
$interpreter->callFunction(
30
$interpreter->loadString(
'mw.text.stripTest = ...'
,
'fortest'
),
31
$markers
32
);
33
}
34
35
protected
function
getTestModules
() {
36
return
parent::getTestModules() + [
37
'TextLibraryTests'
=> __DIR__ .
'/TextLibraryTests.lua'
,
38
];
39
}
40
}
getEngine
getEngine()
Definition
LuaEngineTestHelper.php:109
Scribunto_LuaEngineUnitTestBase
This is the subclass for Lua library tests.
Definition
LuaEngineUnitTestBase.php:12
Scribunto_LuaEngineUnitTestBase\$engineName
$engineName
Definition
LuaEngineUnitTestBase.php:18
Scribunto_LuaTextLibraryTest
Definition
TextLibraryTest.php:3
Scribunto_LuaTextLibraryTest\__construct
__construct( $name=null, array $data=[], $dataName='', $engineName=null)
Definition
TextLibraryTest.php:6
Scribunto_LuaTextLibraryTest\setUp
setUp()
Definition
TextLibraryTest.php:17
Scribunto_LuaTextLibraryTest\getTestModules
getTestModules()
Definition
TextLibraryTest.php:35
Scribunto_LuaTextLibraryTest\$moduleName
static $moduleName
Definition
TextLibraryTest.php:4
extensions
Scribunto
tests
phpunit
engines
LuaCommon
TextLibraryTest.php
Generated on Mon Nov 25 2024 16:04:43 for MediaWiki by
1.10.0