Http::getProxy() method to get proxy configuration
[lhc/web/wiklou.git] / tests / phpunit / includes / HttpTest.php
index e3ee705..246c609 100644 (file)
@@ -62,6 +62,17 @@ class HttpTest extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @covers Http::getProxy
+        */
+       public function testGetProxy() {
+               $this->setMwGlobals( 'wgHTTPProxy', 'proxy.domain.tld' );
+               $this->assertEquals(
+                       'proxy.domain.tld',
+                       Http::getProxy()
+               );
+       }
+
        /**
         * Feeds URI to test a long regular expression in Http::isValidURI
         */
@@ -95,8 +106,8 @@ class HttpTest extends MediaWikiTestCase {
                        # (\S+) - host part is made of anything not whitespaces
                        // commented these out in order to remove @group Broken
                        // @todo are these valid tests? if so, fix Http::isValidURI so it can handle them
-                       //array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ),
-                       //array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ),
+                       // array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ),
+                       // array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ),
 
                        # (:[0-9]+)? - port number
                        array( true, 'http://example.org:80/' ),
@@ -138,7 +149,7 @@ class HttpTest extends MediaWikiTestCase {
         * HTTP redirects).
         */
        public function testRelativeRedirections() {
-               $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext' );
+               $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext', array(), __METHOD__ );
 
                # Forge a Location header
                $h->setRespHeaders( 'location', array(