->getMock();
$mock->expects( $this->any() )
->method( 'makeKey' )
- ->will( $this->returnCallback( function() {
+ ->will( $this->returnCallback( function () {
return implode( ':', func_get_args() );
} ) );
return $mock;
->will( $this->returnValue( 7 ) );
$mockDb->expects( $this->exactly( 1 ) )
->method( 'addQuotes' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return "'$value'";
} ) );
$mockDb->expects( $this->exactly( 1 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
$mockDb = $this->getMockDb();
$mockDb->expects( $this->exactly( 2 * 3 ) )
->method( 'addQuotes' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return "'$value'";
} ) );
$mockDb->expects( $this->exactly( 3 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
$mockDb->expects( $this->any() )
$this->isType( 'array' ),
$this->isType( 'int' )
)
- ->will( $this->returnCallback( function( $a, $conj ) {
+ ->will( $this->returnCallback( function ( $a, $conj ) {
$sqlConj = $conj === LIST_AND ? ' AND ' : ' OR ';
- return join( $sqlConj, array_map( function( $s ) {
+ return join( $sqlConj, array_map( function ( $s ) {
return '(' . $s . ')';
}, $a
) );
$mockDb = $this->getMockDb();
$mockDb->expects( $this->exactly( 2 * 3 ) )
->method( 'addQuotes' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return "'$value'";
} ) );
$mockDb->expects( $this->exactly( 3 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
$mockDb->expects( $this->any() )
$this->isType( 'array' ),
$this->isType( 'int' )
)
- ->will( $this->returnCallback( function( $a, $conj ) {
+ ->will( $this->returnCallback( function ( $a, $conj ) {
$sqlConj = $conj === LIST_AND ? ' AND ' : ' OR ';
- return join( $sqlConj, array_map( function( $s ) {
+ return join( $sqlConj, array_map( function ( $s ) {
return '(' . $s . ')';
}, $a
) );
public function provideDbTypes() {
return [
- [ false, DB_SLAVE ],
+ [ false, DB_REPLICA ],
[ true, DB_MASTER ],
];
}
// Note: This does not actually assert the job is correct
$callableCallCounter = 0;
- $mockCallback = function( $callable ) use ( &$callableCallCounter ) {
+ $mockCallback = function ( $callable ) use ( &$callableCallCounter ) {
$callableCallCounter++;
$this->assertInternalType( 'callable', $callable );
};
// Note: This does not actually assert the job is correct
$callableCallCounter = 0;
- $mockCallback = function( $callable ) use ( &$callableCallCounter ) {
+ $mockCallback = function ( $callable ) use ( &$callableCallCounter ) {
$callableCallCounter++;
$this->assertInternalType( 'callable', $callable );
};
}
/**
- * @param $text
+ * @param string $text
* @param int $ns
*
* @return PHPUnit_Framework_MockObject_MockObject|Title
$callableCallCounter = 0;
$scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback(
- function( $callable ) use ( &$callableCallCounter, $title, $user ) {
+ function ( $callable ) use ( &$callableCallCounter, $title, $user ) {
$callableCallCounter++;
$this->verifyCallbackJob(
$callable,
$title,
$user->getId(),
- function( $time ) {
+ function ( $time ) {
return $time === null;
}
);
$addUpdateCallCounter = 0;
$scopedOverrideDeferred = $store->overrideDeferredUpdatesAddCallableUpdateCallback(
- function( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
+ function ( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
$addUpdateCallCounter++;
$this->verifyCallbackJob(
$callable,
$title,
$user->getId(),
- function( $time ) {
+ function ( $time ) {
return $time !== null && $time > '20151212010101';
}
);
$getTimestampCallCounter = 0;
$scopedOverrideRevision = $store->overrideRevisionGetTimestampFromIdCallback(
- function( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
+ function ( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
$getTimestampCallCounter++;
$this->assertEquals( $title, $titleParam );
$this->assertEquals( $oldid, $oldidParam );
$callableCallCounter = 0;
$scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback(
- function( $callable ) use ( &$callableCallCounter, $title, $user ) {
+ function ( $callable ) use ( &$callableCallCounter, $title, $user ) {
$callableCallCounter++;
$this->verifyCallbackJob(
$callable,
$title,
$user->getId(),
- function( $time ) {
+ function ( $time ) {
return $time === null;
}
);
$addUpdateCallCounter = 0;
$scopedOverrideDeferred = $store->overrideDeferredUpdatesAddCallableUpdateCallback(
- function( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
+ function ( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
$addUpdateCallCounter++;
$this->verifyCallbackJob(
$callable,
$title,
$user->getId(),
- function( $time ) {
+ function ( $time ) {
return $time === '30151212010101';
}
);
$getTimestampCallCounter = 0;
$scopedOverrideRevision = $store->overrideRevisionGetTimestampFromIdCallback(
- function( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
+ function ( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
$getTimestampCallCounter++;
$this->assertEquals( $title, $titleParam );
$this->assertEquals( $oldid, $oldidParam );
$addUpdateCallCounter = 0;
$scopedOverrideDeferred = $store->overrideDeferredUpdatesAddCallableUpdateCallback(
- function( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
+ function ( $callable ) use ( &$addUpdateCallCounter, $title, $user ) {
$addUpdateCallCounter++;
$this->verifyCallbackJob(
$callable,
$title,
$user->getId(),
- function( $time ) {
+ function ( $time ) {
return $time === false;
}
);
$getTimestampCallCounter = 0;
$scopedOverrideRevision = $store->overrideRevisionGetTimestampFromIdCallback(
- function( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
+ function ( $titleParam, $oldidParam ) use ( &$getTimestampCallCounter, $title, $oldid ) {
$getTimestampCallCounter++;
$this->assertEquals( $title, $titleParam );
$this->assertEquals( $oldid, $oldidParam );
->will( $this->returnValue( true ) );
$mockDb->expects( $this->exactly( 1 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
->will( $this->returnValue( true ) );
$mockDb->expects( $this->exactly( 0 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
->will( $this->returnValue( true ) );
$mockDb->expects( $this->exactly( 1 ) )
->method( 'timestamp' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return 'TS' . $value . 'TS';
} ) );
$mockDb->expects( $this->once() )