* @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() {
$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 ) {
* @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();
$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;
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 );
// 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" );
}