wiki.techinc.nl/tests/phpunit/includes/exception/ReadOnlyErrorTest.php
Daimona Eaytoy d3243571d0 Fix DB usage in non-database tests (part 2)
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
2023-08-06 22:57:28 +00:00

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 );
}
}