mediawiki-extensions-Scribunto/tests/phpunit/engines/LuaSandbox/SandboxTests.lua
Kunal Mehta 31820c673a Move tests into tests/phpunit and remove UnitTestsList hook
This takes advantage of extension.json's unit tests autodiscovery
mechanism.

Bug: T142120
Change-Id: Id526f3368fc73ba7e6ef1d793ea70ab05fbd9517
2017-07-07 13:50:39 -07:00

19 lines
452 B
Lua

local testframework = require( 'Module:TestFramework' )
local function setfenv1()
setfenv( 5, {} )
end
local function getfenv1()
assert( getfenv( 5 ) == nil )
end
return testframework.getTestProvider( {
{ name = 'setfenv invalid level', func = setfenv1,
expect = "bad argument #1 to 'old_getfenv' (invalid level)",
},
{ name = 'getfenv invalid level', func = getfenv1,
expect = "bad argument #1 to 'old_getfenv' (invalid level)",
},
} )