This takes us one step closer to deprecating Status, so we can isolate StatusValue from presentation logic. FormatterFactory is introduced as a mechanism for getting instance of formatters that need access to the user interface language and other request dependent information. Usage is demonstrated in thumb.php, SpecialCreateAccount, and SearchHandler. The examples indicates that there is no work do be done around ErrorPageError and LocalizedHttpException. Change-Id: I7fe5fee24cadf934e578c36856cc5d45fb9d0981
28 lines
677 B
PHP
28 lines
677 B
PHP
<?php
|
|
|
|
use MediaWiki\Specials\SpecialCreateAccount;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Specials\SpecialCreateAccount
|
|
*/
|
|
class SpecialCreateAccountTest extends SpecialPageTestBase {
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function newSpecialPage() {
|
|
$services = $this->getServiceContainer();
|
|
return new SpecialCreateAccount(
|
|
$services->getAuthManager(),
|
|
$services->getFormatterFactory()
|
|
);
|
|
}
|
|
|
|
public function testCheckPermissions() {
|
|
$readOnlyMode = $this->getServiceContainer()->getReadOnlyMode();
|
|
$readOnlyMode->setReason( 'Test' );
|
|
|
|
$this->expectException( ErrorPageError::class );
|
|
$specialPage = $this->newSpecialPage();
|
|
$specialPage->checkPermissions();
|
|
}
|
|
}
|