X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fexception%2FThrottledErrorTest.php;h=15f08966dc1a015f0a9e55bde32090c447db1846;hb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4;hp=bdb143faaf2e7f3087fa23fb437e8af0a8fe57a1;hpb=0ff2c62197fdaf79f82d8657afd70621725c9762;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/exception/ThrottledErrorTest.php b/tests/phpunit/includes/exception/ThrottledErrorTest.php index bdb143faaf..15f08966dc 100644 --- a/tests/phpunit/includes/exception/ThrottledErrorTest.php +++ b/tests/phpunit/includes/exception/ThrottledErrorTest.php @@ -2,27 +2,12 @@ /** * @covers ThrottledError - * @author Adam Shorland + * @author Addshore */ class ThrottledErrorTest extends MediaWikiTestCase { - protected $wgOut; - - protected function setUp() { - parent::setUp(); - global $wgOut; - $this->wgOut = clone $wgOut; - } - - protected function tearDown() { - parent::tearDown(); - global $wgOut; - $wgOut = $this->wgOut; - } - public function testExceptionSetsStatusCode() { - global $wgOut; - $wgOut = $this->getMockWgOut(); + $this->setMwGlobals( 'wgOut', $this->getMockWgOut() ); try { throw new ThrottledError(); } catch ( ThrottledError $e ) { @@ -32,7 +17,7 @@ class ThrottledErrorTest extends MediaWikiTestCase { } private function getMockWgOut() { - $mock = $this->getMockBuilder( 'OutputPage' ) + $mock = $this->getMockBuilder( OutputPage::class ) ->disableOriginalConstructor() ->getMock(); $mock->expects( $this->once() )