summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua')
-rw-r--r--www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua b/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
new file mode 100644
index 00000000..8825ddb7
--- /dev/null
+++ b/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
@@ -0,0 +1,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