Merge "Add config for serving main Page from the domain root"
[lhc/web/wiklou.git] / tests / phpunit / includes / db / LBFactoryTest.php
index 1016f28..f00499f 100644 (file)
@@ -32,6 +32,7 @@ use Wikimedia\Rdbms\LoadBalancer;
 use Wikimedia\Rdbms\ChronologyProtector;
 use Wikimedia\Rdbms\MySQLMasterPos;
 use Wikimedia\Rdbms\DatabaseDomain;
+use Wikimedia\Rdbms\LoadMonitorNull;
 
 /**
  * @group Database
@@ -110,7 +111,6 @@ class LBFactoryTest extends MediaWikiTestCase {
                $this->assertSame( $factory->getLocalDomainID(), $factory->resolveDomainID( false ) );
 
                $factory->shutdown();
-               $lb->closeAll();
        }
 
        public function testLBFactorySimpleServers() {
@@ -160,7 +160,6 @@ class LBFactoryTest extends MediaWikiTestCase {
                        'cluster master set' );
 
                $factory->shutdown();
-               $lb->closeAll();
        }
 
        public function testLBFactoryMultiConns() {
@@ -188,7 +187,7 @@ class LBFactoryTest extends MediaWikiTestCase {
                };
 
                $factory = $this->newLBFactoryMultiLBs();
-               $this->assertEquals( 0, $countLBsFunc( $factory ) );
+               $this->assertSame( 0, $countLBsFunc( $factory ) );
                $dbw = $factory->getMainLB()->getConnection( DB_MASTER );
                $this->assertEquals( 1, $countLBsFunc( $factory ) );
                // Test that LoadBalancer instances made during pre-commit callbacks in do not
@@ -209,7 +208,7 @@ class LBFactoryTest extends MediaWikiTestCase {
 
                $called = 0;
                $factory = $this->newLBFactoryMultiLBs();
-               $this->assertEquals( 0, $countLBsFunc( $factory ) );
+               $this->assertSame( 0, $countLBsFunc( $factory ) );
                $dbw = $factory->getMainLB()->getConnection( DB_MASTER );
                $this->assertEquals( 1, $countLBsFunc( $factory ) );
                // Test that LoadBalancer instances made during pre-commit callbacks in do not
@@ -476,17 +475,16 @@ class LBFactoryTest extends MediaWikiTestCase {
                /** @var IMaintainableDatabase $db */
                $db = $lb->getConnection( DB_MASTER, [], '' );
 
-               $this->assertEquals(
+               $this->assertSame(
                        '',
                        $db->getDomainId(),
                        'Null domain ID handle used'
                );
-               $this->assertEquals(
-                       '',
+               $this->assertNull(
                        $db->getDBname(),
                        'Null domain ID handle used'
                );
-               $this->assertEquals(
+               $this->assertSame(
                        '',
                        $db->tablePrefix(),
                        'Main domain ID handle used; prefix is empty though'
@@ -556,7 +554,7 @@ class LBFactoryTest extends MediaWikiTestCase {
                /** @var IMaintainableDatabase $db */
                $db = $lb->getConnection( DB_MASTER, [], '' );
 
-               $this->assertEquals( '', $db->getDomainID(), "Null domain used" );
+               $this->assertSame( '', $db->getDomainID(), "Null domain used" );
 
                $this->assertEquals(
                        $this->quoteTable( $db, 'page' ),
@@ -718,7 +716,7 @@ class LBFactoryTest extends MediaWikiTestCase {
                $lb->forEachOpenConnection( function () use ( &$n ) {
                        ++$n;
                } );
-               $this->assertEquals( 0, $n, "Connections closed" );
+               $this->assertSame( 0, $n, "Connections closed" );
 
                $conn2 = $lb->getConnectionRef( DB_MASTER );
                $this->assertEquals(