Skip to content

Commit

Permalink
Merge "repo\tests: Use namespaced classes (1)"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Jun 20, 2024
2 parents a65ffcd + a686cf3 commit 943b41f
Show file tree
Hide file tree
Showing 36 changed files with 50 additions and 48 deletions.
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Actions/ActionTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use Article;
use Exception;
use InvalidArgumentException;
use MediaWiki\Context\RequestContext;
use MediaWiki\Output\OutputPage;
use MediaWiki\Request\FauxRequest;
use MediaWiki\User\User;
use MediaWikiIntegrationTestCase;
use RequestContext;
use RuntimeException;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\EntityId;
Expand Down
5 changes: 3 additions & 2 deletions repo/tests/phpunit/includes/Api/ApiConventionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

use ApiBase;
use ApiMain;
use MediaWiki\Message\Message;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Tests\Api\ApiTestContext;
use MediaWikiIntegrationTestCase;
use Message;
use ReflectionMethod;

/**
Expand Down Expand Up @@ -43,7 +44,7 @@ public function testApiConventions( $moduleClass, $moduleName ) {
$user = $this->getTestUser()->getUser();

$request = new FauxRequest( $params, true );
$ctx = new \ApiTestContext();
$ctx = new ApiTestContext();
$ctx = $ctx->newTestContext( $request, $user );
$main = new ApiMain( $ctx );
$module = new $moduleClass( $main, $moduleName );
Expand Down
3 changes: 2 additions & 1 deletion repo/tests/phpunit/includes/Api/ApiFormatTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use ApiMain;
use MediaWiki\MediaWikiServices;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Tests\Api\ApiTestContext;
use MediaWiki\User\User;
use MediaWikiIntegrationTestCase;
use Wikibase\DataModel\Entity\Item;
Expand Down Expand Up @@ -64,7 +65,7 @@ protected function getApiModule( $moduleClass, $moduleName, array $params, $need
$params['token'] = $this->user->getEditToken();
}
$request = new FauxRequest( $params, true );
$ctx = new \ApiTestContext();
$ctx = new ApiTestContext();
$ctx = $ctx->newTestContext( $request, $this->user );
$main = new ApiMain( $ctx, true );

Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/ApiUserBlockedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use ApiUsageException;
use MediaWiki\Block\DatabaseBlock;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Services\Statement\GuidGenerator;

Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use DOMXPath;
use MediaWiki\MediaWikiServices;
use MediaWiki\Site\HashSiteStore;
use TestSites;
use MediaWiki\Tests\Site\TestSites;
use Wikibase\Lib\Tests\FakeCache;
use Wikibase\Repo\Api\EditEntity;
use Wikibase\Repo\Api\GetClaims;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/AvailableBadgesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\Lib\SettingsArray;

/**
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/EntitySavingHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use ApiUsageException;
use LogicException;
use MediaWiki\Context\RequestContext;
use MediaWiki\Debug\DeprecatablePropertyArray;
use MediaWiki\MediaWikiServices;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use RequestContext;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\Item;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/EntityTermsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use ApiMain;
use ApiPageSet;
use ApiQuery;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Title\Title;
use MediaWikiLangTestCase;
use RequestContext;
use Wikibase\DataAccess\Tests\FakePrefetchingTermLookup;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/FormatEntitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use ApiUsageException;
use HashBagOStuff;
use MediaWiki\MainConfigNames;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Property;
use Wikibase\DataModel\Term\Fingerprint;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use ApiUsageException;
use DataValues\DataValue;
use DataValues\StringValue;
use DataValues\TimeValue;
use DataValues\UnboundedQuantityValue;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\DataModel\Entity\EntityIdValue;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/GetClaimsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use ApiUsageException;
use DataValues\Serializers\DataValueSerializer;
use DataValues\StringValue;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\NumericPropertyId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\EntityRedirect;
use Wikibase\DataModel\Entity\Item;
Expand Down
4 changes: 2 additions & 2 deletions repo/tests/phpunit/includes/Api/IntegrationApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use MediaWiki\MediaWikiServices;
use TestSites;
use MediaWiki\Tests\Api\ApiTestCase;
use MediaWiki\Tests\Site\TestSites;

/**
* This class holds simple integration tests for Wikibase API modules
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/ListSubscribersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use ApiMain;
use ApiQuery;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Site\HashSiteStore;
use MediaWikiLangTestCase;
use RequestContext;
use Wikibase\DataModel\Entity\ItemIdParser;
use Wikibase\Repo\Api\ListSubscribers;
use Wikibase\Repo\WikibaseRepo;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/MergeItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
use MediaWiki\Site\HashSiteStore;
use MediaWiki\Site\SiteLookup;
use MediaWiki\Status\Status;
use MediaWiki\Tests\Site\TestSites;
use MediaWiki\Tests\User\TempUser\TempUserTestTrait;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use MediaWikiIntegrationTestCase;
use NullStatsdDataFactory;
use TestSites;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\EntityRedirect;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use MediaWiki\Tests\Api\ApiTestCase;
use Wikibase\Lib\LanguageNameLookup;
use Wikibase\Lib\LanguageNameLookupFactory;
use Wikibase\Lib\StaticContentLanguages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use ApiMain;
use ApiQuery;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWikiIntegrationTestCase;
use RequestContext;
use Wikibase\Lib\SettingsArray;
use Wikibase\Repo\Api\MetaDataBridgeConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
use ApiPageSet;
use ApiQuery;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Status\Status;
use MediaWiki\Tests\Unit\Permissions\MockAuthorityTrait;
use MediaWiki\Title\Title;
use MediaWikiIntegrationTestCase;
use RequestContext;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Term\Term;
use Wikibase\Lib\ContentLanguages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use ApiMain;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Revision\SlotRecord;
use MediaWikiIntegrationTestCase;
use RequestContext;
use Wikibase\DataAccess\DatabaseEntitySource;
use Wikibase\DataAccess\EntitySourceDefinitions;
use Wikibase\DataAccess\EntitySourceLookup;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/Api/SearchEntitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use ApiMain;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Status\Status;
use RequestContext;
use Wikibase\DataAccess\DatabaseEntitySource;
use Wikibase\DataAccess\EntitySourceDefinitions;
use Wikibase\DataAccess\EntitySourceLookup;
Expand Down
6 changes: 3 additions & 3 deletions repo/tests/phpunit/includes/Api/WikibaseApiTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

namespace Wikibase\Repo\Tests\Api;

use ApiTestCase;
use ApiTestContext;
use ApiUsageException;
use ChangeTags;
use DataValues\StringValue;
use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\MediaWikiServices;
use MediaWiki\Permissions\Authority;
use MediaWiki\Site\HashSiteStore;
use MediaWiki\Tests\Api\ApiTestCase;
use MediaWiki\Tests\Api\ApiTestContext;
use MediaWiki\Tests\Site\TestSites;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use OutOfBoundsException;
use PHPUnit\Framework\Constraint\Constraint;
use TestSites;
use Wikibase\DataModel\Entity\Property;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\Lib\Normalization\DataValueNormalizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Wikibase\Repo\Tests\ChangeOp;

use MediaWiki\Site\HashSiteStore;
use TestSites;
use MediaWiki\Tests\Site\TestSites;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Services\Statement\GuidGenerator;
use Wikibase\Repo\ChangeOp\ChangeOpFactoryProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use MediaWiki\Site\HashSiteStore;
use MediaWiki\Site\MediaWikiPageNameNormalizer;
use MediaWiki\Site\Site;
use MediaWiki\Tests\Site\TestSites;
use MediaWikiIntegrationTestCase;
use PHPUnit\Framework\MockObject\MockObject;
use TestSites;
use ValueValidators\Error;
use ValueValidators\Result;
use Wikibase\DataModel\Entity\EntityIdValue;
Expand Down
4 changes: 2 additions & 2 deletions repo/tests/phpunit/includes/Content/EntityHandlerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
use DataValues\Serializers\DataValueSerializer;
use DummySearchIndexFieldDefinition;
use InvalidArgumentException;
use LinkBatch;
use LogicException;
use MediaWiki\Cache\LinkBatch;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Context\RequestContext;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Site\Site;
use MediaWiki\Title\Title;
use MediaWikiIntegrationTestCase;
use RequestContext;
use RuntimeException;
use SearchEngine;
use Serializers\Serializer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Diff\Comparer\ComparableComparer;
use Diff\Differ\OrderedListDiffer;
use Diff\DiffOp\Diff\Diff;
use MediaWiki\Context\RequestContext;
use MediaWiki\Site\SiteLookup;
use RequestContext;
use Wikibase\DataModel\Services\Diff\ItemDiff;
use Wikibase\Repo\Content\EntityContentDiff;
use Wikibase\Repo\Diff\ClaimDiffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Wikibase\Repo\Tests\Diff;

use MediaWiki\Context\RequestContext;
use MediaWikiIntegrationTestCase;
use RequestContext;
use Wikibase\Repo\Diff\EntityContentDiffView;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Diff\Comparer\ComparableComparer;
use Diff\Differ\OrderedListDiffer;
use MediaWiki\Context\RequestContext;
use MediaWiki\Site\SiteLookup;
use RequestContext;
use Wikibase\Repo\Diff\BasicEntityDiffVisualizer;
use Wikibase\Repo\Diff\ClaimDiffer;
use Wikibase\Repo\Diff\EntityDiffVisualizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Content;
use Diff\Comparer\ComparableComparer;
use Diff\Differ\OrderedListDiffer;
use MediaWiki\Context\RequestContext;
use MediaWiki\Output\OutputPage;
use MediaWiki\Site\SiteLookup;
use MediaWiki\Title\Title;
use RequestContext;
use Wikibase\DataModel\Entity\EntityRedirect;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/ItemMoveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Wikibase\Repo\Tests;

use MediaWiki\MediaWikiServices;
use MediaWiki\Tests\Site\TestSites;
use MediaWiki\Title\Title;
use MediaWikiIntegrationTestCase;
use TestSites;
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\Lib\Store\EntityRevision;
Expand Down
2 changes: 1 addition & 1 deletion repo/tests/phpunit/includes/MediaWikiEditEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Wikibase\Repo\Tests;

use MediaWiki\Context\RequestContext;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Status\Status;
use MediaWiki\Title\Title;
Expand All @@ -12,7 +13,6 @@
use MediaWiki\User\User;
use MediaWikiIntegrationTestCase;
use ReflectionMethod;
use RequestContext;
use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\EntityRedirect;
use Wikibase\DataModel\Entity\Item;
Expand Down
Loading

0 comments on commit 943b41f

Please sign in to comment.