mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-04 04:38:08 +00:00
f76ba3c465
Instead of per-file. This happens to also fix a false positive with the PhpunitAnnotations sniff. Change-Id: I22621c37217ed2db9d8b3591df1a1421c25fa7f6
28 lines
737 B
PHP
28 lines
737 B
PHP
<?php
|
|
|
|
class Scribunto_LuaStandaloneTest extends Scribunto_LuaEngineTestBase {
|
|
protected static $moduleName = 'StandaloneTests';
|
|
|
|
public static function suite( $className ) {
|
|
return self::makeSuite( $className, 'LuaStandalone' );
|
|
}
|
|
|
|
protected function setUp() {
|
|
parent::setUp();
|
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
$func = $interpreter->wrapPhpFunction( function ( $v ) {
|
|
return [ preg_replace( '/\s+/', ' ', trim( var_export( $v, 1 ) ) ) ];
|
|
} );
|
|
$interpreter->callFunction(
|
|
$interpreter->loadString( 'mw.var_export = ...', 'fortest' ), $func
|
|
);
|
|
}
|
|
|
|
protected function getTestModules() {
|
|
return parent::getTestModules() + [
|
|
'StandaloneTests' => __DIR__ . '/StandaloneTests.lua',
|
|
];
|
|
}
|
|
}
|