4 * @covers ThrottledError
5 * @author Adam Shorland
7 class ThrottledErrorTest
extends MediaWikiTestCase
{
11 protected function setUp() {
14 $this->wgOut
= clone $wgOut;
17 protected function tearDown() {
20 $wgOut = $this->wgOut
;
23 public function testExceptionSetsStatusCode() {
25 $wgOut = $this->getMockWgOut();
27 throw new ThrottledError();
29 catch( ThrottledError
$e ) {
31 $this->assertTrue( true );
35 private function getMockWgOut() {
36 $mock = $this->getMockBuilder( 'OutputPage' )
37 ->disableOriginalConstructor()
39 $mock->expects( $this->once() )
40 ->method( 'setStatusCode' )