X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fauth%2FThrottlerTest.php;h=33c8ce6e105fe800bb6c49417c7e970f3114486c;hp=dba748b57853b831e6868737c4761b737590746e;hb=424251a2cb5842727756d96f877c787c443ea056;hpb=aff17edd95620bff595dfa88013b422b38b1db2a diff --git a/tests/phpunit/includes/auth/ThrottlerTest.php b/tests/phpunit/includes/auth/ThrottlerTest.php index dba748b578..33c8ce6e10 100644 --- a/tests/phpunit/includes/auth/ThrottlerTest.php +++ b/tests/phpunit/includes/auth/ThrottlerTest.php @@ -14,15 +14,6 @@ use Psr\Log\NullLogger; * @covers MediaWiki\Auth\Throttler */ class ThrottlerTest extends \MediaWikiTestCase { - protected function setUp() { - global $wgDisableAuthManager; - - parent::setUp(); - if ( $wgDisableAuthManager ) { - $this->markTestSkipped( '$wgDisableAuthManager is set' ); - } - } - public function testConstructor() { $cache = new \HashBagOStuff(); $logger = $this->getMockBuilder( AbstractLogger::class ) @@ -172,7 +163,8 @@ class ThrottlerTest extends \MediaWikiTestCase { } public function testExpiration() { - $cache = $this->getMock( HashBagOStuff::class, [ 'add' ] ); + $cache = $this->getMockBuilder( HashBagOStuff::class ) + ->setMethods( [ 'add' ] )->getMock(); $throttler = new Throttler( [ [ 'count' => 3, 'seconds' => 10 ] ], [ 'cache' => $cache ] ); $throttler->setLogger( new NullLogger() ); @@ -205,7 +197,7 @@ class ThrottlerTest extends \MediaWikiTestCase { ->setMethods( [ 'log' ] ) ->getMockForAbstractClass(); $logger->expects( $this->once() )->method( 'log' )->with( $this->anything(), $this->anything(), [ - 'type' => 'custom', + 'throttle' => 'custom', 'index' => 0, 'ip' => '1.2.3.4', 'username' => 'SomeUser',