Test that classes use all their ServiceOptions
[lhc/web/wiklou.git] / tests / phpunit / includes / block / BlockManagerTest.php
index b8f60c4..71f76e7 100644 (file)
@@ -4,7 +4,6 @@ use MediaWiki\Block\BlockManager;
 use MediaWiki\Block\DatabaseBlock;
 use MediaWiki\Block\CompositeBlock;
 use MediaWiki\Block\SystemBlock;
-use MediaWiki\Config\ServiceOptions;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\TestingAccessWrapper;
 
@@ -14,6 +13,7 @@ use Wikimedia\TestingAccessWrapper;
  * @coversDefaultClass \MediaWiki\Block\BlockManager
  */
 class BlockManagerTest extends MediaWikiTestCase {
+       use TestAllServiceOptionsUsed;
 
        /** @var User */
        protected $user;
@@ -50,7 +50,8 @@ class BlockManagerTest extends MediaWikiTestCase {
                $this->setMwGlobals( $blockManagerConfig );
                $this->overrideMwServices();
                return [
-                       new ServiceOptions(
+                       new LoggedServiceOptions(
+                               self::$serviceOptionsAccessLog,
                                BlockManager::$constructorOptions,
                                MediaWikiServices::getInstance()->getMainConfig()
                        ),
@@ -160,27 +161,6 @@ class BlockManagerTest extends MediaWikiTestCase {
                ];
        }
 
-       /**
-        * @covers ::isLocallyBlockedProxy
-        */
-       public function testIsLocallyBlockedProxyDeprecated() {
-               $proxy = '1.2.3.4';
-
-               $this->hideDeprecated(
-                       'IP addresses in the keys of $wgProxyList (found the following IP ' .
-                       'addresses in keys: ' . $proxy . ', please move them to values)'
-               );
-
-               $blockManager = TestingAccessWrapper::newFromObject(
-                       $this->getBlockManager( [
-                               'wgProxyList' => [ $proxy => 'test' ]
-                       ] )
-               );
-
-               $ip = '1.2.3.4';
-               $this->assertTrue( $blockManager->isLocallyBlockedProxy( $ip ) );
-       }
-
        /**
         * @dataProvider provideIsDnsBlacklisted
         * @covers ::isDnsBlacklisted
@@ -701,4 +681,10 @@ class BlockManagerTest extends MediaWikiTestCase {
                ];
        }
 
+       /**
+        * @coversNothing
+        */
+       public function testAllServiceOptionsUsed() {
+               $this->assertAllServiceOptionsUsed( [ 'ApplyIpBlocksToXff', 'SoftBlockRanges' ] );
+       }
 }