mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-13 08:48:39 +00:00
18d122b60d
This reverts commit 62e1fb0b5f
.
Reason for revert: caused several errors:
* unnamespaced HooksTest collides with core’s class of the same name
* Scribunto_LuaError renamed without class alias despite being used in Wikibase
Bug: T314464
Change-Id: I8b151327236bf86945e59823fba155497e4b3fc6
29 lines
764 B
PHP
29 lines
764 B
PHP
<?php
|
|
|
|
class LuaStandaloneTest extends Scribunto_LuaEngineUnitTestBase {
|
|
/** @inheritDoc */
|
|
protected static $moduleName = 'StandaloneTests';
|
|
|
|
public static function suite( $className ) {
|
|
return self::makeSuite( $className, 'LuaStandalone' );
|
|
}
|
|
|
|
protected function setUp(): void {
|
|
parent::setUp();
|
|
|
|
$interpreter = $this->getEngine()->getInterpreter();
|
|
$func = $interpreter->wrapPhpFunction( static 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',
|
|
];
|
|
}
|
|
}
|