r112244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112243‎ | r112244 | r112245 >
Date:21:19, 23 February 2012
Author:awjrichards
Status:ok
Tags:
Comment:
Added test for updateMobileUrlHost()
Modified paths:
  • /trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php
@@ -76,4 +76,13 @@
7777 $this->assertEquals( '/path/morepath', $wgExtMobileFrontend->parseMobileUrlTemplate( 'path' ) );
7878 $this->assertEquals( array( 'host' => '%h0.m.%h1.%h2', 'path' => '/path/morepath' ), $wgExtMobileFrontend->parseMobileUrlTemplate());
7979 }
 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+ }
8089 }

Status & tagging log