r100592 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100591‎ | r100592 | r100593 >
Date:09:32, 24 October 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
test {{SERVERNAME}} with relative URLS

bug 31176 mentionned an issue with {{SERVERNAME}} returning the full
URL instead of servername when using relative URLs (//localhost).
The fix was made by r98193.

This patch test three different URL protocols (http, https & relative)
and check we return the expected 'localhost'.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/parser/MagicVariableTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/MagicVariableTest.php
@@ -117,6 +117,24 @@
118118 $this->assertUnPadded( 'revisionmonth1', $month );
119119 }
120120
 121+ /**
 122+ * Rough tests for {{SERVERNAME}} magic word
 123+ * Bug 31176
 124+ */
 125+ function testServernameFromDifferentProtocols() {
 126+ global $wgServer;
 127+ $saved_wgServer= $wgServer;
 128+
 129+ $wgServer = 'http://localhost/';
 130+ $this->assertMagic( 'localhost', 'servername' );
 131+ $wgServer = 'https://localhost/';
 132+ $this->assertMagic( 'localhost', 'servername' );
 133+ $wgServer = '//localhost/'; # bug 31176
 134+ $this->assertMagic( 'localhost', 'servername' );
 135+
 136+ $wgServer = $saved_wgServer;
 137+ }
 138+
121139 ############### HELPERS ############################################
122140
123141 /** assertion helper expecting a magic output which is zero padded */

Follow-up revisions

RevisionCommit summaryAuthorDate
r100750REL1_18 MFT r98997, r99118, r99370, r99700, r100239, r100242, r100347, r10051...reedy21:51, 25 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98193(bug 31176) {{SERVERNAME}} doesn't play nice with protocol-relative URLscatrope23:14, 26 September 2011

Comments

#Comment by Hashar (talk | contribs)   09:33, 24 October 2011

tagging 1.18 to get it in Jenkins for REL1_18

Status & tagging log