###
### Internal links
###
+!! article
+Main Page
+!! text
+blah blah
+!! endarticle
+
!! test
Plain link, capitalized
!! input
</p>
!! end
-# NOTE: it is assumed that [[Category:MediaWiki User's Guide]] exists. It may be necessary to
-# create it, because there are no categories in a default MediaWiki installation. Ideally the
-# parser tester could create a category for testing purposes; this may be necessary for
-# templates anyway.
+!! article
+Category:MediaWiki User's Guide
+!! text
+blah
+!! endarticle
+
!! test
Link to category
!! input
</p>
!! end
+###
+### Images
+###
+
+!! test
+[[
+
##
## XHTML tidiness
!! test
Magic links: ISBN
!! input
-ISBN 0-306-40615-2
+ISBN 0-306-40615-2
!! result
<p><a href="/index.php?title=Special:Booksources&isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
</p>
</p>
!! end
+###
+### Templates
+####
+!! article
+Template:test
+!! text
+This is a test template
+!! endarticle
+
+!! test
+Simple template
+!! input
+{{test}}
+!! result
+<p>This is a test template
+</p>
+!! end
+
+!! test
+Template with explicit namespace
+!! input
+{{Template:test}}
+!! result
+<p>This is a test template
+</p>
+!! end
+
+
+!! article
+Template:paramtest
+!! text
+This is a test template with parameter {{{param}}}
+!! endarticle
+
+!! test
+Template parameter
+!! input
+{{paramtest|param=foo}}
+!! result
+<p>This is a test template with parameter foo
+</p>
+!! end
+
+!! test
+Magic variable as template parameter
+!! input
+{{paramtest|param={{SITENAME}}}}
+!! result
+<p>This is a test template with parameter MediaWiki
+</p>
+!! 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
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+</p>
+!! 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