2013-02-05 00:44:44 +00:00
|
|
|
<?php
|
|
|
|
|
2019-08-03 18:19:46 +00:00
|
|
|
class Scribunto_LuaStandaloneTest extends Scribunto_LuaEngineUnitTestBase {
|
2013-02-05 00:44:44 +00:00
|
|
|
protected static $moduleName = 'StandaloneTests';
|
|
|
|
|
|
|
|
public static function suite( $className ) {
|
|
|
|
return self::makeSuite( $className, 'LuaStandalone' );
|
|
|
|
}
|
|
|
|
|
2019-10-11 18:31:29 +00:00
|
|
|
protected function setUp() : void {
|
2013-09-24 19:07:54 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
|
|
$func = $interpreter->wrapPhpFunction( function ( $v ) {
|
2017-06-15 17:19:00 +00:00
|
|
|
return [ preg_replace( '/\s+/', ' ', trim( var_export( $v, 1 ) ) ) ];
|
2013-09-24 19:07:54 +00:00
|
|
|
} );
|
|
|
|
$interpreter->callFunction(
|
|
|
|
$interpreter->loadString( 'mw.var_export = ...', 'fortest' ), $func
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function getTestModules() {
|
2017-06-15 17:19:00 +00:00
|
|
|
return parent::getTestModules() + [
|
2013-02-05 00:44:44 +00:00
|
|
|
'StandaloneTests' => __DIR__ . '/StandaloneTests.lua',
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2013-02-05 00:44:44 +00:00
|
|
|
}
|
|
|
|
}
|