$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'text';
- $this->mergeMwGlobalArrayValue( 'wgContentHandlers', array(
+ $this->mergeMwGlobalArrayValue( 'wgContentHandlers', [
"BackupTextPassTestModel" => "BackupTextPassTestModelHandler"
- ) );
+ ] );
$ns = $this->getDefaultWikitextNS();
// class), we have to assert, that the page id are consecutively
// increasing
$this->assertEquals(
- array( $this->pageId2, $this->pageId3, $this->pageId4 ),
- array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ),
+ [ $this->pageId2, $this->pageId3, $this->pageId4 ],
+ [ $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ],
"Page ids increasing without holes" );
}
// Setting up the dump
$nameStub = $this->setUpStub();
$nameFull = $this->getNewTempFile();
- $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub,
- "--output=file:" . $nameFull ) );
+ $dumper = new TextPassDumper( [ "--stub=file:" . $nameStub,
+ "--output=file:" . $nameFull ] );
$dumper->reporting = false;
- $dumper->setDb( $this->db );
+ $dumper->setDB( $this->db );
// Performing the dump
$dumper->dump( WikiExporter::FULL, WikiExporter::TEXT );
function testPrefetchPlain() {
// The mapping between ids and text, for the hits of the prefetch mock
- $prefetchMap = array(
- array( $this->pageId1, $this->revId1_1, "Prefetch_________1Text1" ),
- array( $this->pageId2, $this->revId2_3, "Prefetch_________2Text3" )
- );
+ $prefetchMap = [
+ [ $this->pageId1, $this->revId1_1, "Prefetch_________1Text1" ],
+ [ $this->pageId2, $this->revId2_3, "Prefetch_________2Text3" ]
+ ];
// The mock itself
- $prefetchMock = $this->getMock( 'BaseDump', array( 'prefetch' ), array(), '', false );
+ $prefetchMock = $this->getMock( 'BaseDump', [ 'prefetch' ], [], '', false );
$prefetchMock->expects( $this->exactly( 6 ) )
->method( 'prefetch' )
->will( $this->returnValueMap( $prefetchMap ) );
$nameStub = $this->setUpStub();
$nameFull = $this->getNewTempFile();
- $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub,
- "--output=file:" . $nameFull ) );
+ $dumper = new TextPassDumper( [ "--stub=file:" . $nameStub,
+ "--output=file:" . $nameFull ] );
$dumper->prefetch = $prefetchMock;
$dumper->reporting = false;
- $dumper->setDb( $this->db );
+ $dumper->setDB( $this->db );
// Performing the dump
$dumper->dump( WikiExporter::FULL, WikiExporter::TEXT );
"Creating temporary output directory " );
$this->setUpStub( $nameStub, $iterations );
$dumper = new TextPassDumper();
- $dumper->loadWithArgv( array( "--stub=file:" . $nameStub,
+ $dumper->loadWithArgv( [ "--stub=file:" . $nameStub,
"--output=" . $checkpointFormat . ":" . $nameOutputDir . "/full",
"--maxtime=1" /*This is in minutes. Fixup is below*/,
"--buffersize=32768", // The default of 32 iterations fill up 32KB about twice
- "--checkpointfile=checkpoint-%s-%s.xml.gz" ) );
- $dumper->setDb( $this->db );
+ "--checkpointfile=checkpoint-%s-%s.xml.gz" ] );
+ $dumper->setDB( $this->db );
$dumper->maxTimeAllowed = $checkpointAfter; // Patching maxTime from 1 minute
$dumper->stderr = $stderr;
*/
function testBufferSizeSetting( $expected, $size, $msg ) {
$dumper = new TextPassDumperAccessor();
- $dumper->loadWithArgv( array( "--buffersize=" . $size ) );
+ $dumper->loadWithArgv( [ "--buffersize=" . $size ] );
$dumper->execute();
$this->assertEquals( $expected, $dumper->getBufferSize(), $msg );
}
*/
function bufferSizeProvider() {
// expected, bufferSize to initialize with, message
- return array(
- array( 512 * 1024, 512 * 1024, "Setting 512KB is not effective" ),
- array( 8192, 8192, "Setting 8KB is not effective" ),
- array( 4096, 2048, "Could set buffer size below lower bound" )
- );
+ return [
+ [ 512 * 1024, 512 * 1024, "Setting 512KB is not effective" ],
+ [ 8192, 8192, "Setting 8KB is not effective" ],
+ [ 4096, 2048, "Could set buffer size below lower bound" ]
+ ];
}
}