3 use MediaWiki\Output\OutputPage
;
6 * @covers \ThrottledError
9 class ThrottledErrorTest
extends MediaWikiIntegrationTestCase
{
11 public function testExceptionSetsStatusCode() {
12 $mockOut = $this->createMock( OutputPage
::class );
13 $mockOut->expects( $this->once() )
14 ->method( 'setStatusCode' )
16 $this->setMwGlobals( 'wgOut', $mockOut );
19 throw new ThrottledError();
20 } catch ( ThrottledError
$e ) {
23 $text = ob_get_clean();
24 $this->assertStringContainsString( $e->getMessage(), $text );