Page MenuHomeWickedGov Phorge

MediaWikiIntegrationTestCaseNoDbTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

MediaWikiIntegrationTestCaseNoDbTest.php

<?php
use MediaWiki\MediaWikiServices;
/**
* Verify that the database is unavailable in integration tests which didn't
* indicate otherwise.
* @see MediaWikiIntegrationTestCase::needsDB()
* @coversNothing
*/
class MediaWikiIntegrationTestCaseNoDbTest extends MediaWikiIntegrationTestCase {
public function testDBLoadBalancerFactory() {
$this->expectException( RuntimeException::class );
$this->expectExceptionMessage( 'Database backend disabled' );
MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
}
public function testDBLoadBalancer() {
$this->expectException( RuntimeException::class );
$this->expectExceptionMessage( 'Database backend disabled' );
MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_REPLICA );
}
public function testServiceContainer() {
$this->expectException( RuntimeException::class );
$this->expectExceptionMessage( 'Database backend disabled' );
$this->getServiceContainer()->getDBLoadBalancer()->getConnection( DB_REPLICA );
}
public function testGetDb() {
$this->expectException( LogicException::class );
$this->getDb();
}
public function testDbProp() {
$this->assertNull( $this->db );
}
public function testAllowedMethods() {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$lbFactory->getMainLB();
$lbFactory->getLocalDomainID();
MediaWikiServices::getInstance()->getDBLoadBalancer()->getLocalDomainID();
$this->getServiceContainer()->getReadOnlyMode()->isReadOnly();
$this->addToAssertionCount( 1 );
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Jul 3, 20:13 (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
38/f6/fd32fc44d77938b69e1e8855e104
Default Alt Text
MediaWikiIntegrationTestCaseNoDbTest.php (1 KB)

Event Timeline