Index: trunk/phase3/tests/phpunit/includes/parser/MagicVariableTest.php |
— | — | @@ -117,6 +117,24 @@ |
118 | 118 | $this->assertUnPadded( 'revisionmonth1', $month ); |
119 | 119 | } |
120 | 120 | |
| 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 | + |
121 | 139 | ############### HELPERS ############################################ |
122 | 140 | |
123 | 141 | /** assertion helper expecting a magic output which is zero padded */ |