mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-15 11:59:42 +00:00
b2d340bf71
Change-Id: I8ccb645fa11f001fc1ca1c95f4e9476f84870714
34 lines
805 B
PHP
34 lines
805 B
PHP
<?php
|
|
|
|
if ( PHP_SAPI !== 'cli' ) exit;
|
|
require_once( __DIR__ . '/../LuaCommon/LuaEngineTest.php' );
|
|
|
|
class Scribunto_LuaSandboxEngineTest extends Scribunto_LuaEngineTest {
|
|
var $stdOpts = array(
|
|
'memoryLimit' => 50000000,
|
|
'cpuLimit' => 30,
|
|
'allowEnvFuncs' => true,
|
|
);
|
|
|
|
function newEngine( $opts = array() ) {
|
|
$opts = $opts + $this->stdOpts;
|
|
return new Scribunto_LuaSandboxEngine( $opts );
|
|
}
|
|
|
|
function getTestModules() {
|
|
return parent::getTestModules() + array(
|
|
'SandboxTests' => __DIR__ . '/SandboxTests.lua'
|
|
);
|
|
}
|
|
|
|
function provideSandboxTests() {
|
|
return $this->getTestProvider( 'SandboxTests' );
|
|
}
|
|
|
|
/** @dataProvider provideSandboxTests */
|
|
function testSandboxTests( $key, $testName, $expected ) {
|
|
$this->runTestProvider( 'SandboxTests', $key, $testName, $expected );
|
|
}
|
|
}
|
|
|