X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fmaintenance%2Fbackup_LogTest.php;h=5cf172e6aa813a8b4326f3fc85a23918f1386a41;hb=53b4dcd2b8364471b4db731d21013e88e84d56fb;hp=8a8dea5a4ddf4ff490edddbf03a32a58b1d08a9b;hpb=c87a63935a2595f6c24f0a3af94cd29d2b82f80a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/maintenance/backup_LogTest.php b/tests/phpunit/maintenance/backup_LogTest.php index 8a8dea5a4d..5cf172e6aa 100644 --- a/tests/phpunit/maintenance/backup_LogTest.php +++ b/tests/phpunit/maintenance/backup_LogTest.php @@ -28,18 +28,18 @@ class BackupDumperLoggerTest extends DumpTestCase { * @return int id of the added log entry */ private function addLogEntry( $type, $subtype, User $user, $ns, $title, - $comment = null, $parameters = null ) { - - $logEntry = new ManualLogEntry( $type, $subtype ); + $comment = null, $parameters = null + ) { + $logEntry = new ManualLogEntry( $type, $subtype ); $logEntry->setPerformer( $user ); $logEntry->setTarget( Title::newFromText( $title, $ns ) ); - if ( $comment !== null ) { + if ( $comment !== null ) { $logEntry->setComment( $comment ); } - if ( $parameters !== null ) { + if ( $parameters !== null ) { $logEntry->setParameters( $parameters ); } - return $logEntry->insert(); + return $logEntry->insert(); } function addDBData() { @@ -73,7 +73,7 @@ class BackupDumperLoggerTest extends DumpTestCase { $this->logId3 = $this->addLogEntry( 'move', 'delete', $user2, NS_MAIN, "PageA", "SomeOtherComment", - array( 'key1' => 1, 3 => 'value3' ) ); + array( 'key1' => 1, 3 => 'value3' ) ); $this->assertGreaterThan( 0, $this->logId3 ); } catch ( Exception $e ) { @@ -101,7 +101,8 @@ class BackupDumperLoggerTest extends DumpTestCase { * @param $parameters array: (optional) unserialized data accompanying the log entry */ private function assertLogItem( $id, $user_name, $user_id, $comment, $type, - $subtype, $title, $parameters = array() ) { + $subtype, $title, $parameters = array() + ) { $this->assertNodeStart( "logitem" ); $this->skipWhitespace(); @@ -134,12 +135,12 @@ class BackupDumperLoggerTest extends DumpTestCase { $this->skipWhitespace(); } - function testPlain () { + function testPlain() { global $wgContLang; // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=file:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); $dumper->startId = $this->logId1; $dumper->endId = $this->logId3 + 1; $dumper->reporting = false; @@ -172,10 +173,12 @@ class BackupDumperLoggerTest extends DumpTestCase { function testXmlDumpsBackupUseCaseLogging() { global $wgContLang; + $this->checkHasGzip(); + // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=gzip:" . $fname, - "--reporting=2" ) ); + $dumper = new BackupDumper( array( "--output=gzip:" . $fname, + "--reporting=2" ) ); $dumper->startId = $this->logId1; $dumper->endId = $this->logId3 + 1; $dumper->setDb( $this->db ); @@ -186,7 +189,7 @@ class BackupDumperLoggerTest extends DumpTestCase { // to be able to alert (once dumping produces reports) that this test // needs updates. $dumper->stderr = fopen( 'php://output', 'a' ); - if ( $dumper->stderr === FALSE ) { + if ( $dumper->stderr === false ) { $this->fail( "Could not open stream for stderr" ); }