Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / ThrottlerTest.php
index dba748b..33c8ce6 100644 (file)
@@ -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',