MediaWiki REL1_34
TextLibraryTest.php
Go to the documentation of this file.
1<?php
2
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}
This is the subclass for Lua library tests.
__construct( $name=null, array $data=[], $dataName='', $engineName=null)