Module:Template test case: Difference between revisions

    (protect call templateObj:getOutput())
    (protect calling self._invocation:getOutput{...})
    Line 156: Line 156:


    function Template:getOutput()
    function Template:getOutput()
    return self._invocation:getOutput{
    local protect = require('Module:Protect')
    -- calling self._invocation:getOutput{...}
    return protect(self._invocation.getOutput)(self._invocation, {
    template = self:getName(),
    template = self:getName(),
    requireMagicWord = self.requireMagicWord,
    requireMagicWord = self.requireMagicWord,
    }
    })
    end
    end


    Line 302: Line 304:


    function TestCase:getTemplateOutput(templateObj)
    function TestCase:getTemplateOutput(templateObj)
    local protect = require('Module:Protect')
    local output = templateObj:getOutput()
    -- calling templateObj:getOutput()
    local output = protect(templateObj.getOutput)(templateObj)
    if self.options.resetRefs then
    if self.options.resetRefs then
    mw.getCurrentFrame():extensionTag('references')
    mw.getCurrentFrame():extensionTag('references')