dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add checkDependencies.php"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
db
/
LBFactoryTest.php
diff --git
a/tests/phpunit/includes/db/LBFactoryTest.php
b/tests/phpunit/includes/db/LBFactoryTest.php
index
02c25e7
..
f7007e7
100644
(file)
--- a/
tests/phpunit/includes/db/LBFactoryTest.php
+++ b/
tests/phpunit/includes/db/LBFactoryTest.php
@@
-23,7
+23,6
@@
* @copyright © 2013 Wikimedia Foundation Inc.
*/
* @copyright © 2013 Wikimedia Foundation Inc.
*/
-use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IMaintainableDatabase;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IMaintainableDatabase;
use Wikimedia\Rdbms\LBFactory;
@@
-31,7
+30,6
@@
use Wikimedia\Rdbms\LBFactorySimple;
use Wikimedia\Rdbms\LBFactoryMulti;
use Wikimedia\Rdbms\LoadBalancer;
use Wikimedia\Rdbms\ChronologyProtector;
use Wikimedia\Rdbms\LBFactoryMulti;
use Wikimedia\Rdbms\LoadBalancer;
use Wikimedia\Rdbms\ChronologyProtector;
-use Wikimedia\Rdbms\DatabaseMysqli;
use Wikimedia\Rdbms\MySQLMasterPos;
use Wikimedia\Rdbms\DatabaseDomain;
use Wikimedia\Rdbms\MySQLMasterPos;
use Wikimedia\Rdbms\DatabaseDomain;
@@
-48,7
+46,7
@@
class LBFactoryTest extends MediaWikiTestCase {
* @dataProvider getLBFactoryClassProvider
*/
public function testGetLBFactoryClass( $expected, $deprecated ) {
* @dataProvider getLBFactoryClassProvider
*/
public function testGetLBFactoryClass( $expected, $deprecated ) {
- $mockDB = $this->getMockBuilder(
DatabaseMysqli
::class )
+ $mockDB = $this->getMockBuilder(
IDatabase
::class )
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();
@@
-292,7
+290,7
@@
class LBFactoryTest extends MediaWikiTestCase {
$m2Pos = new MySQLMasterPos( 'db1064-bin.002400/794074907', $now );
// Master DB 1
$m2Pos = new MySQLMasterPos( 'db1064-bin.002400/794074907', $now );
// Master DB 1
- $mockDB1 = $this->getMockBuilder(
DatabaseMysqli
::class )
+ $mockDB1 = $this->getMockBuilder(
IDatabase
::class )
->disableOriginalConstructor()
->getMock();
$mockDB1->method( 'writesOrCallbacksPending' )->willReturn( true );
->disableOriginalConstructor()
->getMock();
$mockDB1->method( 'writesOrCallbacksPending' )->willReturn( true );
@@
-317,7
+315,7
@@
class LBFactoryTest extends MediaWikiTestCase {
$lb1->method( 'getMasterPos' )->willReturn( $m1Pos );
$lb1->method( 'getServerName' )->with( 0 )->willReturn( 'master1' );
// Master DB 2
$lb1->method( 'getMasterPos' )->willReturn( $m1Pos );
$lb1->method( 'getServerName' )->with( 0 )->willReturn( 'master1' );
// Master DB 2
- $mockDB2 = $this->getMockBuilder(
DatabaseMysqli
::class )
+ $mockDB2 = $this->getMockBuilder(
IDatabase
::class )
->disableOriginalConstructor()
->getMock();
$mockDB2->method( 'writesOrCallbacksPending' )->willReturn( true );
->disableOriginalConstructor()
->getMock();
$mockDB2->method( 'writesOrCallbacksPending' )->willReturn( true );
@@
-348,7
+346,8
@@
class LBFactoryTest extends MediaWikiTestCase {
[
'ip' => '127.0.0.1',
'agent' => "Totally-Not-FireFox"
[
'ip' => '127.0.0.1',
'agent' => "Totally-Not-FireFox"
- ]
+ ],
+ null
);
$mockDB1->expects( $this->exactly( 1 ) )->method( 'writesOrCallbacksPending' );
);
$mockDB1->expects( $this->exactly( 1 ) )->method( 'writesOrCallbacksPending' );
@@
-357,11
+356,11
@@
class LBFactoryTest extends MediaWikiTestCase {
$mockDB2->expects( $this->exactly( 1 ) )->method( 'lastDoneWrites' );
// Nothing to wait for on first HTTP request start
$mockDB2->expects( $this->exactly( 1 ) )->method( 'lastDoneWrites' );
// Nothing to wait for on first HTTP request start
- $cp->
initLB
( $lb1 );
- $cp->
initLB
( $lb2 );
+ $cp->
applySessionReplicationPosition
( $lb1 );
+ $cp->
applySessionReplicationPosition
( $lb2 );
// Record positions in stash on first HTTP request end
// Record positions in stash on first HTTP request end
- $cp->s
hutdownLB
( $lb1 );
- $cp->s
hutdownLB
( $lb2 );
+ $cp->s
toreSessionReplicationPosition
( $lb1 );
+ $cp->s
toreSessionReplicationPosition
( $lb2 );
$cpIndex = null;
$cp->shutdown( null, 'sync', $cpIndex );
$cpIndex = null;
$cp->shutdown( null, 'sync', $cpIndex );
@@
-396,11
+395,11
@@
class LBFactoryTest extends MediaWikiTestCase {
);
// Wait for last positions to be reached on second HTTP request start
);
// Wait for last positions to be reached on second HTTP request start
- $cp->
initLB
( $lb1 );
- $cp->
initLB
( $lb2 );
+ $cp->
applySessionReplicationPosition
( $lb1 );
+ $cp->
applySessionReplicationPosition
( $lb2 );
// Shutdown (nothing to record)
// Shutdown (nothing to record)
- $cp->s
hutdownLB
( $lb1 );
- $cp->s
hutdownLB
( $lb2 );
+ $cp->s
toreSessionReplicationPosition
( $lb1 );
+ $cp->s
toreSessionReplicationPosition
( $lb2 );
$cpIndex = null;
$cp->shutdown( null, 'sync', $cpIndex );
$cpIndex = null;
$cp->shutdown( null, 'sync', $cpIndex );
@@
-730,7
+729,7
@@
class LBFactoryTest extends MediaWikiTestCase {
$factory->destroy();
}
$factory->destroy();
}
- private function quoteTable( Database $db, $table ) {
+ private function quoteTable(
I
Database $db, $table ) {
if ( $db->getType() === 'sqlite' ) {
return $table;
} else {
if ( $db->getType() === 'sqlite' ) {
return $table;
} else {