From df424c01c88434de933b1cdd9c8ba97ab8bbe764 Mon Sep 17 00:00:00 2001
From: Wil Mahan
This is a test template +
+!! end + +!! test +Template with explicit namespace +!! input +{{Template:test}} +!! result +This is a test template +
+!! end + + +!! article +Template:paramtest +!! text +This is a test template with parameter {{{param}}} +!! endarticle + +!! test +Template parameter +!! input +{{paramtest|param=foo}} +!! result +This is a test template with parameter foo +
+!! end + +!! test +Magic variable as template parameter +!! input +{{paramtest|param={{SITENAME}}}} +!! result +This is a test template with parameter MediaWiki +
+!! end + +!! article +Template:linktest +!! text +[[{{{param}}}|foo]] +!! endarticle + +XXX this works outside of parser testing +!! test +!! disabled +Template parameter as link source +!! input +{{linktest|param=Main Page}} +!! result + +!! end + +### +### Pre-save transform tests +### +!! test +pre-save transform: subst: +!! options +PST +!! input +{{subst:test}} +!! result +This is a test template +!! end + +!! test +pre-save transform: normal template +!! options +PST +!! input +{{test}} +!! result +{{test}} +!! end + +!! test +pre-save transform: subst magic variables +!! options +pst +!! input +{{subst:SITENAME}} +!! result +MediaWiki +!! end + +### +### Message transform tests +### +!! test +message transform: magic variables +!! options +msg +!! input +{{SITENAME}} +!! result +MediaWiki +!! end + +!! test +message transform: should transform wiki markup +!! options +msg +!! input +''test'' +!! result +''test'' +!! end + TODO: +more templates +tables +images subpages -templates +pre-save transform and message transform checking and much more -- 2.20.1