MediaWiki  1.34.4
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 }
Scribunto_LuaStandaloneTest
Definition: StandaloneTest.php:3
Scribunto_LuaEngineUnitTestBase
This is the subclass for Lua library tests.
Definition: LuaEngineUnitTestBase.php:12
Scribunto_LuaStandaloneTest\$moduleName
static $moduleName
Definition: StandaloneTest.php:4
Scribunto_LuaStandaloneTest\setUp
setUp()
Definition: StandaloneTest.php:10
Scribunto_LuaStandaloneTest\getTestModules
getTestModules()
Definition: StandaloneTest.php:22
Scribunto_LuaStandaloneTest\suite
static suite( $className)
Definition: StandaloneTest.php:6
makeSuite
static makeSuite( $className, $group=null)
Definition: LuaEngineTestHelper.php:24
getEngine
getEngine()
Definition: LuaEngineTestHelper.php:109