Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / GetReplicaServerTest.php
blobbe710b75944c4f9b8a4a9ea75fe98b3cfbadbf1c
1 <?php
3 namespace MediaWiki\Tests\Maintenance;
5 use GetReplicaServer;
7 /**
8 * @covers \GetReplicaServer
9 * @group Database
10 * @author Dreamy Jazz
12 class GetReplicaServerTest extends MaintenanceBaseTestCase {
14 protected function getMaintenanceClass() {
15 return GetReplicaServer::class;
18 public function testExecuteForUnknownCluster() {
19 $this->maintenance->setOption( 'cluster', 'invalid-cluster' );
20 $this->expectCallToFatalError();
21 $this->expectOutputRegex( "/Error: Unknown cluster 'invalid-cluster'/" );
22 $this->maintenance->execute();
25 public function testExecute() {
26 $this->maintenance->execute();
27 $expectedServerName = $this->getDb()->getServerName();
28 $this->expectOutputString( "$expectedServerName\n" );