Merge "Remove m prefixes from private variables"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / DumpTestCase.php
index 78a5153..6950fa3 100644 (file)
@@ -48,7 +48,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                throw new MWException( "Could not determine revision id (" . $status->getWikiText() . ")" );
        }
 
-
        /**
         * gunzips the given file and stores the result in the original file name
         *
@@ -60,11 +59,14 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                if ( $gzipped_contents === false ) {
                        $this->fail( "Could not get contents of $fname" );
                }
-               // We resort to use gzinflate instead of gzdecode, as gzdecode
-               // need not be available
-               $contents = gzinflate( substr( $gzipped_contents, 10, -8 ) );
-               $this->assertEquals( strlen( $contents ),
-                       file_put_contents( $fname, $contents ), "# bytes written" );
+
+               $contents = gzdecode( $gzipped_contents );
+
+               $this->assertEquals(
+                       strlen( $contents ),
+                       file_put_contents( $fname, $contents ),
+                       '# bytes written'
+               );
        }
 
        /**
@@ -107,14 +109,13 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                }
        }
 
-
        /**
         * Step the current XML reader until node end of given name is found.
         *
         * @param $name string: name of the closing element to look for
         *           (e.g.: "mediawiki" when looking for </mediawiki>)
         *
-        * @return bool: true iff the end node could be found. false otherwise.
+        * @return bool: true if the end node could be found. false otherwise.
         */
        protected function skipToNodeEnd( $name ) {
                while ( $this->xml->read() ) {
@@ -227,7 +228,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                }
        }
 
-
        /**
         * Asserts that the xml reader is at an element of given tag that contains a given text,
         * and skips over the element.