$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
) );
$mock->expects( $this->any() )
->method( 'addQuotes' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return "'$value'";
} ) );
$mock->expects( $this->any() )
->method( 'bitAnd' )
- ->willReturnCallback( function( $a, $b ) {
+ ->willReturnCallback( function ( $a, $b ) {
return "($a & $b)";
} );
}
/**
- * @param $mockDb
+ * @param PHPUnit_Framework_MockObject_MockObject|Database $mockDb
* @return PHPUnit_Framework_MockObject_MockObject|LoadBalancer
*/
private function getMockLoadBalancer( $mockDb ) {
->getMock();
$mock->expects( $this->any() )
->method( 'getConnectionRef' )
- ->with( DB_SLAVE )
+ ->with( DB_REPLICA )
->will( $this->returnValue( $mockDb ) );
return $mock;
}
$mock->expects( $this->any() )
->method( 'isAllowed' )
- ->will( $this->returnCallback( function( $action ) use ( $notAllowedAction ) {
+ ->will( $this->returnCallback( function ( $action ) use ( $notAllowedAction ) {
return $action !== $notAllowedAction;
} ) );
$mock->expects( $this->any() )
->method( 'isAllowedAny' )
- ->will( $this->returnCallback( function() use ( $notAllowedAction ) {
+ ->will( $this->returnCallback( function () use ( $notAllowedAction ) {
$actions = func_get_args();
return !in_array( $notAllowedAction, $actions );
} ) );
$mockDb = $this->getMockDb();
$mockDb->expects( $this->any() )
->method( 'addQuotes' )
- ->will( $this->returnCallback( function( $value ) {
+ ->will( $this->returnCallback( function ( $value ) {
return "'$value'";
} ) );
$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
) );