wiki.techinc.nl/tests/phpunit/includes/specials/SpecialCreateAccountTest.php
Func 4d1da6f7f8 phpunit: Update @covers annotations for namespaced classes
We renamed many classes to be namespaced, but the `@covers` and
`@coversDefaultClass` annotations weren't updated properly.

PHPUnit didn't support short cover annotations with `use` statements,
these didn't trigger any errors yet, because they are class alias.

This patch is populated by a modified version of PhpunitAnnotationsSniff.

Change-Id: I6c602290a30099239b17d2dc0d67b1488b4eaeeb
2023-05-27 17:43:12 +08:00

27 lines
639 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()
);
}
public function testCheckPermissions() {
$readOnlyMode = $this->getServiceContainer()->getReadOnlyMode();
$readOnlyMode->setReason( 'Test' );
$this->expectException( ErrorPageError::class );
$specialPage = $this->newSpecialPage();
$specialPage->checkPermissions();
}
}