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();
28 } catch ( ThrottledError
$e ) {
30 $this->assertTrue( true );
34 private function getMockWgOut() {
35 $mock = $this->getMockBuilder( 'OutputPage' )
36 ->disableOriginalConstructor()
38 $mock->expects( $this->once() )
39 ->method( 'setStatusCode' )