MediaWiki  1.23.2
ThrottledErrorTest.php
Go to the documentation of this file.
1 <?php
2 
8 
9  protected $wgOut;
10 
11  protected function setUp() {
12  parent::setUp();
13  global $wgOut;
14  $this->wgOut = clone $wgOut;
15  }
16 
17  protected function tearDown() {
18  parent::tearDown();
19  global $wgOut;
21  }
22 
23  public function testExceptionSetsStatusCode() {
24  global $wgOut;
25  $wgOut = $this->getMockWgOut();
26  try {
27  throw new ThrottledError();
28  } catch ( ThrottledError $e ) {
29  $e->report();
30  $this->assertTrue( true );
31  }
32  }
33 
34  private function getMockWgOut() {
35  $mock = $this->getMockBuilder( 'OutputPage' )
36  ->disableOriginalConstructor()
37  ->getMock();
38  $mock->expects( $this->once() )
39  ->method( 'setStatusCode' )
40  ->with( 429 );
41  return $mock;
42  }
43 
44 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
ThrottledError
Show an error when the user hits a rate limit.
Definition: ThrottledError.php:27
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ThrottledErrorTest
@covers ThrottledError
Definition: ThrottledErrorTest.php:7
ThrottledErrorTest\setUp
setUp()
Definition: ThrottledErrorTest.php:11
ThrottledErrorTest\$wgOut
$wgOut
Definition: ThrottledErrorTest.php:9
ThrottledErrorTest\tearDown
tearDown()
Definition: ThrottledErrorTest.php:17
ThrottledErrorTest\getMockWgOut
getMockWgOut()
Definition: ThrottledErrorTest.php:34
ThrottledErrorTest\testExceptionSetsStatusCode
testExceptionSetsStatusCode()
Definition: ThrottledErrorTest.php:23
$e
if( $useReadline) $e
Definition: eval.php:66