Merge "Make AuthManager::getAuthenticationProvider() public"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 1 Jun 2016 18:54:48 +0000 (18:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 1 Jun 2016 18:54:48 +0000 (18:54 +0000)
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/maintenance/DumpTestCase.php

index e0a7ea3..8dfe628 100644 (file)
@@ -1650,32 +1650,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                }
        }
 
-       /**
-        * Check whether we have the 'gzip' commandline utility, will skip
-        * the test whenever "gzip -V" fails.
-        *
-        * Result is cached at the process level.
-        *
-        * @return bool
-        *
-        * @since 1.21
-        */
-       protected function checkHasGzip() {
-               static $haveGzip;
-
-               if ( $haveGzip === null ) {
-                       $retval = null;
-                       wfShellExec( 'gzip -V', $retval );
-                       $haveGzip = ( $retval === 0 );
-               }
-
-               if ( !$haveGzip ) {
-                       $this->markTestSkipped( "Skip test, requires the gzip utility in PATH" );
-               }
-
-               return $haveGzip;
-       }
-
        /**
         * Check if $extName is a loaded PHP extension, will skip the
         * test whenever it is not loaded.
index ac83d4e..1d55ab8 100644 (file)
@@ -25,6 +25,26 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         */
        protected $xml = null;
 
+       /** @var bool|null Whether the 'gzip' utility is available */
+       protected static $hasGzip = null;
+
+       /**
+        * Skip the test if 'gzip' is not in $PATH.
+        *
+        * @return bool
+        */
+       protected function checkHasGzip() {
+               if ( self::$hasGzip === null ) {
+                       self::$hasGzip = ( Installer::locateExecutableInDefaultPaths( 'gzip' ) !== false );
+               }
+
+               if ( !self::$hasGzip ) {
+                       $this->markTestSkipped( "Skip test, requires the gzip utility in PATH" );
+               }
+
+               return self::$hasGzip;
+       }
+
        /**
         * Adds a revision to a page, while returning the resuting revision's id
         *