Page MenuHomeWickedGov Phorge

ThrottledErrorTest.php
No OneTemporary

Size
601 B
Referenced Files
None
Subscribers
None

ThrottledErrorTest.php

<?php
use MediaWiki\Output\OutputPage;
/**
* @covers \ThrottledError
* @author Addshore
*/
class ThrottledErrorTest extends MediaWikiIntegrationTestCase {
public function testExceptionSetsStatusCode() {
$mockOut = $this->createMock( OutputPage::class );
$mockOut->expects( $this->once() )
->method( 'setStatusCode' )
->with( 429 );
$this->setMwGlobals( 'wgOut', $mockOut );
try {
throw new ThrottledError();
} catch ( ThrottledError $e ) {
ob_start();
$e->report();
$text = ob_get_clean();
$this->assertStringContainsString( $e->getMessage(), $text );
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 06:16 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
82/64/c7656526710fa37aceb6cc797837
Default Alt Text
ThrottledErrorTest.php (601 B)

Event Timeline