wiki.techinc.nl/tests/phpunit/includes/api/ApiDisabledTest.php
Daimona Eaytoy ef5ab69629 Replace setExpectedException with two args
Find: ^(\t*)(\$this->)setExpectedException\(\s+(\\?[a-z\\]+::class),\s+('(?:[^'\\]|\\')+'|"(?:[^"\\]|\\")+")\s+\);

Replace: $1$2expectException( $3 );\n$1\$this->expectExceptionMessage( $4 );

+broke long lines manually.

Bug: T192167
Change-Id: I5557b4372625def55a53ac637c2f980f51f12933
2019-10-05 16:14:05 +00:00

19 lines
422 B
PHP

<?php
/**
* @group API
* @group medium
*
* @covers ApiDisabled
*/
class ApiDisabledTest extends ApiTestCase {
public function testDisabled() {
$this->mergeMwGlobalArrayValue( 'wgAPIModules',
[ 'login' => 'ApiDisabled' ] );
$this->expectException( ApiUsageException::class );
$this->expectExceptionMessage( 'The "login" module has been disabled.' );
$this->doApiRequest( [ 'action' => 'login' ] );
}
}