Module:Protection banner: Difference between revisions

allow specifying a data table to config objects for testing purposes
(use lang:formatDate instead of os.date as it is easier to localise)
(allow specifying a data table to config objects for testing purposes)
Line 18: Line 18:
local Config = class('Config')
local Config = class('Config')


function Config:initialize()
function Config:initialize(data)
local data = mw.loadData('Module:Protection banner/config')
data = data or mw.loadData('Module:Protection banner/config')
self._cfg = data.cfg
self._cfg = data.cfg
self._msg = data.msg
self._msg = data.msg