Mock the relevant services that need the DB instead, when possible. When not possible, e.g. because DB access is needed for the test to make sense, add the test to the Database group instead. Change-Id: Iefbfe00bedc243906c6b860572568343268646cc
21 lines
541 B
PHP
21 lines
541 B
PHP
<?php
|
|
|
|
use MediaWiki\Tests\Unit\DummyServicesTrait;
|
|
|
|
/**
|
|
* @covers ReadOnlyError
|
|
* @author Addshore
|
|
*/
|
|
class ReadOnlyErrorTest extends MediaWikiIntegrationTestCase {
|
|
use DummyServicesTrait;
|
|
|
|
public function testConstruction() {
|
|
$reason = 'This site is read-only for $reasons';
|
|
$this->setService( 'ReadOnlyMode', $this->getDummyReadOnlyMode( $reason ) );
|
|
$e = new ReadOnlyError();
|
|
$this->assertEquals( 'readonly', $e->title );
|
|
$this->assertEquals( 'readonlytext', $e->msg );
|
|
$this->assertEquals( $reason, $e->params );
|
|
}
|
|
|
|
}
|