Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / tests / phpunit / includes / exception / ThrottledErrorTest.php
blob23bb1e860162c22d8dd4036ced3fb2e2f7d8fa01
1 <?php
3 /**
4 * @covers ThrottledError
5 * @author Addshore
6 */
7 class ThrottledErrorTest extends MediaWikiTestCase {
9 public function testExceptionSetsStatusCode() {
10 $this->setMwGlobals( 'wgOut', $this->getMockWgOut() );
11 try {
12 throw new ThrottledError();
13 } catch ( ThrottledError $e ) {
14 $e->report();
15 $this->assertTrue( true );
19 private function getMockWgOut() {
20 $mock = $this->getMockBuilder( 'OutputPage' )
21 ->disableOriginalConstructor()
22 ->getMock();
23 $mock->expects( $this->once() )
24 ->method( 'setStatusCode' )
25 ->with( 429 );
26 return $mock;