mediawiki-extensions-Scribunto/tests/engines/LuaSandbox/LuaSandboxEngineTest.php
Ori Livneh b2d340bf71 (Bug 37957) php_sapi_name() => PHP_SAPI
Change-Id: I8ccb645fa11f001fc1ca1c95f4e9476f84870714
2013-02-04 20:27:01 -08:00

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 );
}
}