Debian Codegraph @

tests/phpunit/maintenance/GetReplicaServerTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Maintenance;
4
5 use GetReplicaServer;
6
7 /**
8 * @covers GetReplicaServer
9 * @group Database
10 * @author Dreamy Jazz
11 */
12 class GetReplicaServerTest extends MaintenanceBaseTestCase {
13
14 protected function getMaintenanceClass() {
15 return GetReplicaServer::class;
16 }
17
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();
23 }
24
25 public function testExecute() {
26 $this->maintenance->execute();
27 $expectedServerName = $this->getDb()->getServerName();
28 $this->expectOutputString( "$expectedServerName\n" );
29 }
30 }