MediaWiki REL1_34
StandaloneTest.php
Go to the documentation of this file.
1<?php
2
4 protected static $moduleName = 'StandaloneTests';
5
6 public static function suite( $className ) {
7 return self::makeSuite( $className, 'LuaStandalone' );
8 }
9
10 protected function setUp() {
11 parent::setUp();
12
13 $interpreter = $this->getEngine()->getInterpreter();
14 $func = $interpreter->wrapPhpFunction( function ( $v ) {
15 return [ preg_replace( '/\s+/', ' ', trim( var_export( $v, 1 ) ) ) ];
16 } );
17 $interpreter->callFunction(
18 $interpreter->loadString( 'mw.var_export = ...', 'fortest' ), $func
19 );
20 }
21
22 protected function getTestModules() {
23 return parent::getTestModules() + [
24 'StandaloneTests' => __DIR__ . '/StandaloneTests.lua',
25 ];
26 }
27}
static makeSuite( $className, $group=null)
This is the subclass for Lua library tests.
static suite( $className)