r86344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86343‎ | r86344 | r86345 >
Date:20:37, 18 April 2011
Author:svip
Status:deferred
Tags:
Comment:
Added parser tests for TemplateAdventures. More to come.
Modified paths:
  • /trunk/extensions/TemplateAdventures/TemplateAdventures.php (modified) (history)
  • /trunk/extensions/TemplateAdventures/taParserTests.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/TemplateAdventures/TemplateAdventures.php
@@ -42,7 +42,7 @@
4343 'author' => array( 'Svip' ),
4444 'url' => 'http://www.mediawiki.org/wiki/Extension:TemplateAdventures',
4545 'descriptionmsg' => 'ta-desc',
46 - 'version' => '0.1'
 46+ 'version' => '0.2'
4747 );
4848
4949
Index: trunk/extensions/TemplateAdventures/taParserTests.txt
@@ -0,0 +1,44 @@
 2+!! test
 3+Just an author
 4+!! input
 5+{{#citation:|author=Wales, Jimmy}}
 6+!! result
 7+<p><span class="citation">Wales, Jimmy.</span>
 8+</p>
 9+!! end
 10+
 11+!! test
 12+Just an author by surname and given
 13+!! input
 14+{{#citation:|given=Jimmy|surname=Wales}}
 15+!! result
 16+<p><span class="citation">Wales, Jimmy.</span>
 17+</p>
 18+!! end
 19+
 20+!! test
 21+Two authors by surname and given
 22+!! input
 23+{{#citation:|given 1=Jimmy|surname 1=Wales|given 2=Jimmy|surname 2=Wales}}
 24+!! result
 25+<p><span class="citation">Wales, Jimmy &amp; Wales, Jimmy.</span>
 26+</p>
 27+!! end
 28+
 29+!! test
 30+Three authors by surname and given
 31+!! input
 32+{{#citation:|given=Jimmy|surname=Wales|given 2=Jimmy|surname 2=Wales|given 3=Jimmy|surname 3=Wales}}
 33+!! result
 34+<p><span class="citation">Wales, Jimmy; Wales, Jimmy &amp; Wales, Jimmy.</span>
 35+</p>
 36+!! end
 37+
 38+!! test
 39+An author with a link
 40+!! input
 41+{{#citation:|author=Wales, Jimmy |url=http://example.com/ |title=Example}}
 42+!! result
 43+<p><span class="citation">Wales, Jimmy. <a href="http://example.com/" class="external text" rel="nofollow">Example</a>
 44+</p>
 45+!! end

Status & tagging log