Missed the case where there is an equals.
authorPlatonides <platonides@users.mediawiki.org>
Mon, 24 Jan 2011 22:10:22 +0000 (22:10 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Mon, 24 Jan 2011 22:10:22 +0000 (22:10 +0000)
It's ugly having to add that literal node there.

tests/phpunit/includes/parser/PreprocessorTest.php

index 89666f4..01569aa 100644 (file)
@@ -53,6 +53,7 @@ class PreprocessorTest extends MediaWikiTestCase {
                        array( "{{Foo|bar}}a", "<root><template><title>Foo</title><part><name index=\"1\" /><value>bar</value></part></template>a</root>" ),  
                        array( "{{Foo|bar|baz}}", "<root><template><title>Foo</title><part><name index=\"1\" /><value>bar</value></part><part><name index=\"2\" /><value>baz</value></part></template></root>" ),  
                        array( "{{Foo|1=bar}}", "<root><template><title>Foo</title><part><name>1</name>=<value>bar</value></part></template></root>" ),
+                       array( "{{Foo|=bar}}", "<root><template><title>Foo</title><part><name></name>=<value>bar</value></part></template></root>" ),
                        array( "{{Foo|bar=baz}}", "<root><template><title>Foo</title><part><name>bar</name>=<value>baz</value></part></template></root>" ), 
                        array( "{{Foo|1=bar|baz}}", "<root><template><title>Foo</title><part><name>1</name>=<value>bar</value></part><part><name index=\"1\" /><value>baz</value></part></template></root>" ), 
                        array( "{{Foo|bar|foo=baz}}", "<root><template><title>Foo</title><part><name index=\"1\" /><value>bar</value></part><part><name>foo</name>=<value>baz</value></part></template></root>" ), 
@@ -84,6 +85,11 @@ class PreprocessorTest extends MediaWikiTestCase {
                        array( "{{Foobar {{Foo}} {{Bar}} {{Baz}} ", "<root>{{Foobar <template><title>Foo</title></template> <template><title>Bar</title></template> <template><title>Baz</title></template> </root>"),
                        array( "[[Foo]] |", "<root>[[Foo]] |</root>"),
                        array( "{{Foo|Bar|", "<root>{{Foo|Bar|</root>"),
+                       array( "[[Foo]", "<root>[[Foo]</root>"),
+                       array( "[[Foo|Bar]", "<root>[[Foo|Bar]</root>"),
+                       array( "{{Foo| [[Bar] }}", "<root>{{Foo| [[Bar] }}</root>"),
+                       array( "{{Foo| [[Bar|Baz] }}", "<root>{{Foo| [[Bar|Baz] }}</root>"),
+                       array( "{{Foo|bar=[[baz]}}", "<root>{{Foo|bar=[[baz]}}</root>"),
                        /* array( file_get_contents( dirname( __FILE__ ) . '/QuoteQuran.txt' ), file_get_contents( dirname( __FILE__ ) . '/QuoteQuranExpanded.txt' ) ), */
                );
        }