2013-02-05 00:44:44 +00:00
|
|
|
<?php
|
|
|
|
|
2016-05-17 14:52:05 +00:00
|
|
|
// @codingStandardsIgnoreLine Squiz.Classes.ValidClassName.NotCamelCaps
|
2013-02-05 00:44:44 +00:00
|
|
|
class Scribunto_LuaStandaloneTests extends Scribunto_LuaEngineTestBase {
|
|
|
|
protected static $moduleName = 'StandaloneTests';
|
|
|
|
|
|
|
|
public static function suite( $className ) {
|
|
|
|
return self::makeSuite( $className, 'LuaStandalone' );
|
|
|
|
}
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function setUp() {
|
2013-09-24 19:07:54 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
|
|
$func = $interpreter->wrapPhpFunction( function ( $v ) {
|
|
|
|
return array( preg_replace( '/\s+/', ' ', trim( var_export( $v, 1 ) ) ) );
|
|
|
|
} );
|
|
|
|
$interpreter->callFunction(
|
|
|
|
$interpreter->loadString( 'mw.var_export = ...', 'fortest' ), $func
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function getTestModules() {
|
2013-02-05 00:44:44 +00:00
|
|
|
return parent::getTestModules() + array(
|
|
|
|
'StandaloneTests' => __DIR__ . '/StandaloneTests.lua',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|