Index: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php |
— | — | @@ -76,4 +76,13 @@ |
77 | 77 | $this->assertEquals( '/path/morepath', $wgExtMobileFrontend->parseMobileUrlTemplate( 'path' ) ); |
78 | 78 | $this->assertEquals( array( 'host' => '%h0.m.%h1.%h2', 'path' => '/path/morepath' ), $wgExtMobileFrontend->parseMobileUrlTemplate()); |
79 | 79 | } |
| 80 | + |
| 81 | + public function testUpdateMobileUrlHost() { |
| 82 | + global $wgMobileUrlTemplate, $wgExtMobileFrontend; |
| 83 | + $updateMobileUrlHost = self::getMethod( "updateMobileUrlHost" ); |
| 84 | + $wgMobileUrlTemplate = "%h0.m.%h1.%h2"; |
| 85 | + $parsedUrl = wfParseUrl( "http://en.wikipedia.org/wiki/Gustavus_Airport" ); |
| 86 | + $updateMobileUrlHost->invokeArgs( $wgExtMobileFrontend, array( &$parsedUrl ) ); |
| 87 | + $this->assertEquals( "http://en.m.wikipedia.org/wiki/Gustavus_Airport", wfAssembleUrl( $parsedUrl ) ); |
| 88 | + } |
80 | 89 | } |