Merge "Add checkDependencies.php"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiBaseTest.php
index e02e8a4..6a44ff3 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\TestingAccessWrapper;
 
 /**
@@ -643,7 +645,7 @@ class ApiBaseTest extends ApiTestCase {
                                        ApiBase::PARAM_ISMULTI => true,
                                        ApiBase::PARAM_TYPE => 'namespace',
                                ],
-                               MWNamespace::getValidNamespaces(),
+                               MediaWikiServices::getInstance()->getNamespaceInfo()->getValidNamespaces(),
                                [],
                        ],
                        // PARAM_ALL is ignored with namespace types.
@@ -654,7 +656,7 @@ class ApiBaseTest extends ApiTestCase {
                                        ApiBase::PARAM_TYPE => 'namespace',
                                        ApiBase::PARAM_ALL => false,
                                ],
-                               MWNamespace::getValidNamespaces(),
+                               MediaWikiServices::getInstance()->getNamespaceInfo()->getValidNamespaces(),
                                [],
                        ],
                        'Namespace with wildcard "x"' => [
@@ -1324,7 +1326,7 @@ class ApiBaseTest extends ApiTestCase {
 
                // Has a blocked $user, so special block handling
                $user = $this->getMutableTestUser()->getUser();
-               $block = new \Block( [
+               $block = new DatabaseBlock( [
                        'address' => $user->getName(),
                        'user' => $user->getID(),
                        'by' => $this->getTestSysop()->getUser()->getId(),
@@ -1335,7 +1337,7 @@ class ApiBaseTest extends ApiTestCase {
                $userInfoTrait = TestingAccessWrapper::newFromObject(
                        $this->getMockForTrait( ApiBlockInfoTrait::class )
                );
-               $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockInfo( $block ) ];
+               $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockDetails( $block ) ];
 
                $expect = Status::newGood();
                $expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );
@@ -1382,7 +1384,7 @@ class ApiBaseTest extends ApiTestCase {
 
                // Has a blocked $user, so special block handling
                $user = $this->getMutableTestUser()->getUser();
-               $block = new \Block( [
+               $block = new DatabaseBlock( [
                        'address' => $user->getName(),
                        'user' => $user->getID(),
                        'by' => $this->getTestSysop()->getUser()->getId(),
@@ -1393,7 +1395,7 @@ class ApiBaseTest extends ApiTestCase {
                $userInfoTrait = TestingAccessWrapper::newFromObject(
                        $this->getObjectForTrait( ApiBlockInfoTrait::class )
                );
-               $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockInfo( $block ) ];
+               $blockinfo = [ 'blockinfo' => $userInfoTrait->getBlockDetails( $block ) ];
 
                $expect = Status::newGood();
                $expect->fatal( ApiMessage::create( 'apierror-blocked', 'blocked', $blockinfo ) );