X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fmaintenance%2FDumpTestCase.php;h=58cb6f3902288a0fb9095ee5ee223feb1c1926a5;hp=ac83d4e70a9ecf8cba683a486fbe059ef7e5a5e0;hb=0e1fc6575e00a9bb6d1f671f5df54b2faade518f;hpb=75cdcc94007dca953927b13db411aac94750b074 diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index ac83d4e70a..58cb6f3902 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -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 = ( ExecutableFinder::findInDefaultPaths( '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 * @@ -278,7 +298,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * @param string $name Title of the current page */ protected function assertPageStart( $id, $ns, $name ) { - $this->assertNodeStart( "page" ); $this->skipWhitespace(); @@ -373,7 +392,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT ) && ( $this->xml->name == "text" ) ) { - $this->xml->read(); } $this->skipWhitespace();