throw new MWException( "Could not determine revision id (" . $status->getWikiText() . ")" );
}
-
/**
* gunzips the given file and stores the result in the original file name
*
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'
+ );
}
/**
}
}
-
/**
* 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() ) {
}
}
-
/**
* Asserts that the xml reader is at an element of given tag that contains a given text,
* and skips over the element.