* When I found it, I cried. fixes bug #22501
authorMark A. Hershberger <mah@users.mediawiki.org>
Tue, 16 Feb 2010 03:37:19 +0000 (03:37 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Tue, 16 Feb 2010 03:37:19 +0000 (03:37 +0000)
* Also, fix up showtitle for parser tests to always give a title, whether we're setting a display title or not.

includes/parser/ParserOutput.php
maintenance/parserTests.inc
maintenance/parserTests.txt

index c7cae73..ea5840e 100644 (file)
@@ -192,6 +192,7 @@ class ParserOutput
                if( $t === '' ) {
                        return false;
                }
+               return $t;
        }
 
        /**
index 3b2e6f0..6526da9 100644 (file)
@@ -371,7 +371,8 @@ class ParserTest {
                        $out = $output->getText();
 
                        if ( isset( $opts['showtitle'] ) ) {
-                               $out = $output->getTitleText() . "\n$out";
+                               if($output->getTitleText()) $title = $output->getTitleText();
+                               $out = "$title\n$out";
                        }
                        if (isset( $opts['ill'] ) ) {
                                $out = $this->tidy( implode( ' ', $output->getLanguageLinks() ) );
@@ -556,8 +557,6 @@ class ParserTest {
                        'wgHtml5' => true,
                        'wgWellFormedXml' => true,
                        'wgAllowMicrodataAttributes' => true,
-                       'wgAllowDisplayTitle' => true,
-                       'wgRestrictDisplayTitle' => false,
                );
 
                if ($config) {
index c68c10a..023f955 100644 (file)
@@ -7785,10 +7785,13 @@ Bar foo
 Verify that displaytitle works (bug #22501) no displaytitle
 !! options
 showtitle
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
 !! input
 this is not the the title
 !! result
-
+Parser test
 <p>this is not the the title
 </p>
 !! end
@@ -7799,6 +7802,7 @@ Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false
 showtitle
 title=[[Screen]]
 !! config
+wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=false
 !! input
 this is not the the title
@@ -7815,12 +7819,13 @@ Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch
 showtitle
 title=[[Screen]]
 !! config
+wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! input
 this is not the the title
 {{DISPLAYTITLE:whatever}}
 !! result
-
+Screen
 <p>this is not the the title
 </p>
 !! end
@@ -7831,6 +7836,7 @@ Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
 showtitle
 title=[[Screen]]
 !! config
+wgAllowDisplayTitle=true
 wgRestrictDisplayTitle=true
 !! input
 this is not the the title
@@ -7852,7 +7858,7 @@ wgAllowDisplayTitle=false
 this is not the the title
 {{DISPLAYTITLE:screen}}
 !! result
-
+Screen
 <p>this is not the the title
 <a href="/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
 </p>
@@ -7868,7 +7874,7 @@ wgAllowDisplayTitle=false
 !! input
 this is not the the title
 !! result
-
+Screen
 <p>this is not the the title
 </p>
 !! end