wiki.techinc.nl/tests/phpunit/includes/exception/ReadOnlyErrorTest.php
thiemowmde 06c13725f1 Fix string→array type mismatch in ReadOnlyError
The parent's ErrorPageError::__construct() expects an array of
params.

Change-Id: I1a3a225df97c75fba20d8b32d5a19e974d80c7a1
2024-01-16 18:16:33 +00:00

21 lines
545 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 );
}
}