Skip to content

Commit

Permalink
Switch the lib/tests folder to PSR-4
Browse files Browse the repository at this point in the history
This is the most minimal patch possible. I'm intentionally *not*
moving any files and not touching the namespaces of classes that
are not used in other files anyway. All these namespaces are purely
cosmetic. I want to do this cosmetic cleanup in an other patch.

Change-Id: I78eacd3c3f1c50a87385682193b50c1d2824a21c
  • Loading branch information
thiemowmde committed Apr 21, 2016
1 parent 7f6c2e5 commit 158730d
Show file tree
Hide file tree
Showing 63 changed files with 71 additions and 56 deletions.
4 changes: 4 additions & 0 deletions client/tests/phpunit/MockClientStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
use Wikibase\ClientStore;
use Wikibase\DataModel\Services\Entity\NullEntityPrefetcher;
use Wikibase\DataModel\Services\Lookup\EntityLookup;
use Wikibase\Lib\Tests\MockPropertyLabelResolver;
use Wikibase\Lib\Tests\MockRepository;
use Wikibase\Lib\Tests\Store\MockPropertyInfoStore;
use Wikibase\Lib\Tests\Store\MockTermIndex;
use Wikibase\PropertyInfoStore;
use Wikibase\Store\EntityIdLookup;
use Wikibase\TermIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Wikibase\ItemChange;
use Wikibase\Lib\Store\SiteLinkLookup;
use Wikibase\Lib\Store\StorageException;
use Wikibase\Test\TestChanges;
use Wikibase\Lib\Tests\Changes\TestChanges;

/**
* @covers Wikibase\Client\Changes\AffectedPagesFinder
Expand Down
4 changes: 2 additions & 2 deletions client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use Wikibase\EntityChange;
use Wikibase\Lib\Store\SiteLinkLookup;
use Wikibase\Lib\Store\StorageException;
use Wikibase\Test\MockRepository;
use Wikibase\Test\TestChanges;
use Wikibase\Lib\Tests\MockRepository;
use Wikibase\Lib\Tests\Changes\TestChanges;

/**
* @covers Wikibase\Client\Changes\ChangeHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Wikibase\EntityChange;
use Wikibase\ItemChange;
use Wikibase\Lib\Store\EntityRevisionLookup;
use Wikibase\Test\MockRepository;
use Wikibase\Test\TestChanges;
use Wikibase\Lib\Tests\MockRepository;
use Wikibase\Lib\Tests\Changes\TestChanges;

/**
* @covers Wikibase\Client\Changes\ChangeRunCoalescer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\SiteLinkList;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\ParserOutput\ClientParserOutputDataUpdater
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Wikibase\Client\PropertyLabelNotResolvedException;
use Wikibase\DataModel\Entity\Property;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\Test\MockPropertyLabelResolver;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockPropertyLabelResolver;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\DataAccess\PropertyIdResolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Wikibase\DataModel\Snak\SnakList;
use Wikibase\LanguageFallbackChainFactory;
use Wikibase\Lib\StaticContentLanguages;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\DataAccess\Scribunto\EntityAccessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Wikibase\Lib\Store\HashSiteLinkStore;
use Wikibase\Lib\Store\SiteLinkLookup;
use Wikibase\SettingsArray;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\DataAccess\Scribunto\WikibaseLuaBindings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Wikibase\DataModel\Statement\Statement;
use Wikibase\DataModel\Statement\StatementList;
use Wikibase\Test\MockClientStore;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* Helper class for Lua integration tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Wikibase\Client\Hooks\OtherProjectsSidebarGenerator;
use Wikibase\Client\Hooks\OtherProjectsSidebarGeneratorFactory;
use Wikibase\SettingsArray;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\Hooks\OtherProjectsSidebarGeneratorFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Wikibase\NamespaceChecker;
use Wikibase\Settings;
use Wikibase\SettingsArray;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers
Expand Down
2 changes: 1 addition & 1 deletion client/tests/phpunit/includes/LangLinkHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Wikibase\LangLinkHandler;
use Wikibase\NamespaceChecker;
use Wikibase\NoLangLinkHandler;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\LangLinkHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\ItemChange;
use Wikibase\SiteLinkCommentCreator;
use Wikibase\Test\TestChanges;
use Wikibase\Lib\Tests\Changes\TestChanges;

/**
* @covers Wikibase\SiteLinkCommentCreator
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
"lib/includes/",
"lib/WikibaseLib.hooks.php",
"lib/maintenance/",
"lib/tests/phpunit/",
"repo/includes/",
"repo/maintenance/",
"repo/tests/phpunit/",
"repo/Wikibase.hooks.php"
],
"psr-4": {
"Wikibase\\Client\\Tests\\": "client/tests/phpunit/includes",
"Wikibase\\Lib\\Tests\\": "lib/tests/phpunit",
"Wikibase\\View\\": "view/src",
"Wikibase\\View\\Tests\\": "view/tests/phpunit",
"Wikimedia\\Purtle\\": "purtle/src",
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Changes/ChangeRowTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Changes;

use MediaWikiTestCase;
use MWException;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Changes/EntityChangeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Changes;

use Diff\DiffOp\Diff\Diff;
use Diff\DiffOp\DiffOpAdd;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Changes/ItemChangeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Changes;

use Diff\DiffOp\Diff\Diff;
use Diff\DiffOp\DiffOpChange;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Changes/TestChanges.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Changes;

use Wikibase\ChangeRow;
use Wikibase\DataModel\Entity\EntityDocument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Wikibase\Lib\WikibaseSnakFormatterBuilders;
use Wikibase\Lib\WikibaseValueFormatterBuilders;
use Wikibase\PropertyInfoStore;
use Wikibase\Test\MockPropertyInfoStore;
use Wikibase\Lib\Tests\Store\MockPropertyInfoStore;

/**
* @covers Wikibase\Lib\WikibaseSnakFormatterBuilders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Wikibase\Lib\Interactors\TermSearchResult;
use Wikibase\Store\BufferingTermLookup;
use Wikibase\TermIndexEntry;
use Wikibase\Test\MockTermIndex;
use Wikibase\Lib\Tests\Store\MockTermIndex;

/**
* @covers Wikibase\Lib\Interactors\TermIndexSearchInteractor
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/MockPropertyLabelResolver.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests;

use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Services\Term\PropertyLabelResolver;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/MockRepository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests;

use Status;
use User;
Expand Down
4 changes: 2 additions & 2 deletions lib/tests/phpunit/MockRepositoryTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests;

use MWException;
use User;
Expand All @@ -18,7 +18,7 @@
use Wikibase\Lib\Store\StorageException;

/**
* @covers Wikibase\Test\MockRepository
* @covers Wikibase\Lib\Tests\MockRepository
*
* @group Wikibase
* @group WikibaseLib
Expand Down
5 changes: 2 additions & 3 deletions lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Lib\Test;
namespace Wikibase\Lib\Tests;

use Wikibase\DataModel\Entity\Property;
use Wikibase\DataModel\Entity\PropertyId;
Expand All @@ -9,8 +9,7 @@
use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException;
use Wikibase\Lib\PropertyInfoDataTypeLookup;
use Wikibase\PropertyInfoStore;
use Wikibase\Test\MockPropertyInfoStore;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\Store\MockPropertyInfoStore;

/**
* @covers Wikibase\Lib\PropertyInfoDataTypeLookup
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Wikibase\Lib\PropertyInfoProvider;
use Wikibase\Lib\PropertyInfoSnakUrlExpander;
use Wikibase\PropertyInfoStore;
use Wikibase\Test\MockPropertyInfoStore;
use Wikibase\Lib\Tests\Store\MockPropertyInfoStore;
use Wikimedia\Assert\ParameterTypeException;

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/BufferingTermLookupTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\DataModel\Entity\EntityId;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Wikibase\EntityRevision;
use Wikibase\Lib\Store\CachingEntityRevisionLookup;
use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Lib\Store\CachingEntityRevisionLookup
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/CachingPropertyInfoStoreTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use HashBagOStuff;
use Wikibase\CachingPropertyInfoStore;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/ChunkCacheTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\ChunkCache;

Expand Down
1 change: 1 addition & 0 deletions lib/tests/phpunit/Store/EntityInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Wikibase\DataModel\Entity\BasicEntityIdParser;
use Wikibase\Lib\Store\EntityInfo;
use Wikibase\Lib\Store\GenericEntityInfoBuilder;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Lib\Store\EntityInfo
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/EntityTermLookupTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\DataModel\Entity\ItemId;
use Wikibase\Lib\Store\EntityTermLookup;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/GenericEntityInfoBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Wikibase\DataModel\Entity\BasicEntityIdParser;
use Wikibase\Lib\Store\GenericEntityInfoBuilder;
use Wikibase\Test\EntityInfoBuilderTest;
use Wikibase\Test\MockRepository;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Lib\Store\GenericEntityInfoBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use MediaWikiTestCase;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/MockChunkAccess.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\ChunkAccess;

Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/MockPropertyInfoStore.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use InvalidArgumentException;
use Wikibase\DataModel\Entity\Property;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/MockPropertyInfoStoreTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\DataModel\Entity\PropertyId;

Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/MockTermIndex.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Exception;
use InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/PropertyInfoStoreTestHelper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use InvalidArgumentException;
use PHPUnit_Framework_TestCase;
Expand Down
1 change: 1 addition & 0 deletions lib/tests/phpunit/Store/RevisionBasedEntityLookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Wikibase\Lib\Store\EntityRevisionLookup;
use Wikibase\Lib\Store\RevisionBasedEntityLookup;
use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
use Wikibase\Lib\Tests\MockRepository;

/**
* @covers Wikibase\Lib\Store\RevisionBasedEntityLookup
Expand Down
1 change: 1 addition & 0 deletions lib/tests/phpunit/Store/Sql/PropertyInfoTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use MediaWikiTestCase;
use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\Lib\Tests\Store\PropertyInfoStoreTestHelper;
use Wikibase\PropertyInfoTable;

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Item;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/TermIndexTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use Wikibase\DataModel\Entity\Item;
use Wikibase\DataModel\Entity\ItemId;
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/phpunit/Store/TermPropertyLabelResolverTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Wikibase\Test;
namespace Wikibase\Lib\Tests\Store;

use HashBagOStuff;
use Wikibase\DataModel\Entity\Item;
Expand Down
Loading

0 comments on commit 158730d

Please sign in to comment.