summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
blob: 8825ddb7fdc1c7291a1094bd9a186892fcaaed1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local p = {}
local php
local options

function p.setupInterface( opts )
	-- Boilerplate
	p.setupInterface = nil
	php = mw_interface
	mw_interface = nil
	options = opts

	-- Loaded dynamically, don't mess with globals like 'mw' or
	-- 'package.loaded'
end

function p.test()
	return options.test, php.test()
end

function p.setVal( frame )
	options.val = frame.args[1]
end

function p.getVal( frame )
	return tostring( options.val )
end

p.foobar = { val = "nope" }

return p