Index: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php |
— | — | @@ -44,10 +44,11 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function testDisableCaching() { |
48 | | - global $wgRequest, $wgExtMobileFrontend; |
| 48 | + global $wgRequest, $wgExtMobileFrontend, $wgSquidServers; |
49 | 49 | $disableCaching = self::getMethod( 'disableCaching' ); |
50 | | - |
51 | | - $_SERVER['HTTP_VIA'] = '.wikimedia.org:3128'; |
| 50 | + |
| 51 | + $wgSquidServers = array( '10.64.0.131' ); |
| 52 | + $_SERVER['REMOTE_ADDR'] = '10.64.0.131'; |
52 | 53 | $disableCaching->invokeArgs( $wgExtMobileFrontend, array() ); |
53 | 54 | $this->assertEquals( 'no-cache, must-revalidate', $wgRequest->response()->getheader( 'Cache-Control' ) ); |
54 | 55 | $this->assertEquals( 'Sat, 26 Jul 1997 05:00:00 GMT', $wgRequest->response()->getheader( 'Expires' ) ); |
— | — | @@ -75,4 +76,4 @@ |
76 | 77 | $this->assertEquals( '/path/morepath', $wgExtMobileFrontend->parseMobileUrlTemplate( 'path' ) ); |
77 | 78 | $this->assertEquals( array( 'host' => '%h0.m.%h1.%h2', 'path' => '/path/morepath' ), $wgExtMobileFrontend->parseMobileUrlTemplate()); |
78 | 79 | } |
79 | | -} |
\ No newline at end of file |
| 80 | +} |