Index: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php |
— | — | @@ -23,21 +23,21 @@ |
24 | 24 | parent::tearDown(); |
25 | 25 | } |
26 | 26 | |
27 | | - public function testgetBaseDomain() { |
| 27 | + public function testGetBaseDomain() { |
28 | 28 | $getBaseDomain = self::getMethod( 'getBaseDomain' ); |
29 | 29 | $wgExtMobileFrontend = new ExtMobileFrontend(); |
30 | 30 | $_SERVER['HTTP_HOST'] = 'en.wikipedia.org'; |
31 | 31 | $this->assertEquals( '.wikipedia.org', $getBaseDomain->invokeArgs( $wgExtMobileFrontend, array() ) ); |
32 | 32 | } |
33 | 33 | |
34 | | - public function testgetRelativeURL() { |
| 34 | + public function testGetRelativeURL() { |
35 | 35 | $getRelativeURL = self::getMethod( 'getRelativeURL' ); |
36 | 36 | $wgExtMobileFrontend = new ExtMobileFrontend(); |
37 | 37 | $url = 'http://en.wikipedia.org/wiki/Positional_astronomy'; |
38 | 38 | $this->assertEquals( '/wiki/Positional_astronomy', $getRelativeURL->invokeArgs( $wgExtMobileFrontend, array( $url ) ) ); |
39 | 39 | } |
40 | 40 | |
41 | | - public function testdisableCaching() { |
| 41 | + public function testDisableCaching() { |
42 | 42 | global $wgRequest; |
43 | 43 | $disableCaching = self::getMethod( 'disableCaching' ); |
44 | 44 | $wgExtMobileFrontend = new ExtMobileFrontend(); |
— | — | @@ -47,4 +47,13 @@ |
48 | 48 | $this->assertEquals( 'Sat, 26 Jul 1997 05:00:00 GMT', $wgRequest->response()->getheader( 'Expires' ) ); |
49 | 49 | $this->assertEquals( 'no-cache', $wgRequest->response()->getheader( 'Pragma' ) ); |
50 | 50 | } |
| 51 | + |
| 52 | + public function testSendXDeviceVaryHeader() { |
| 53 | + global $wgRequest; |
| 54 | + $sendXDeviceVaryHeader = self::getMethod( 'sendXDeviceVaryHeader' ); |
| 55 | + $wgExtMobileFrontend = new ExtMobileFrontend(); |
| 56 | + $_SERVER['HTTP_X_DEVICE'] = 'device'; |
| 57 | + $sendXDeviceVaryHeader->invokeArgs( $wgExtMobileFrontend, array() ); |
| 58 | + $this->assertEquals( $_SERVER['HTTP_X_DEVICE'], $wgRequest->response()->getheader( 'X-Device' ) ); |
| 59 | + } |
51 | 60 | } |
\ No newline at end of file |