Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277211

Change subject: Use PHP 5.5's …::class feature instead of strings in tests
......................................................................

Use PHP 5.5's …::class feature instead of strings in tests

This should be the final patch replacing all class names in strings
with the …::class keyword. This patch is limited to tests. The idea is:
When the tests succeed, all changes in this patch should be fine and
you do not need to do a super-critical character-by-character review.

Change-Id: I487b8180fee9c01385da7ce05e3f86628213bd88
---
M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
M client/tests/phpunit/includes/DataAccess/PropertyIdResolverTest.php
M client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
M 
client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
M client/tests/phpunit/includes/ForbiddenSerializerTest.php
M 
client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
M client/tests/phpunit/includes/Store/Sql/DirectSqlStoreTest.php
M client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php
M lib/tests/phpunit/EntityRevisionLookupTest.php
M lib/tests/phpunit/MockRepositoryTest.php
M lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php
M lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php
M lib/tests/phpunit/TermIndexEntryTest.php
M lib/tests/phpunit/changes/EntityChangeFactoryTest.php
M lib/tests/phpunit/changes/EntityChangeTest.php
M lib/tests/phpunit/changes/ItemChangeTest.php
M lib/tests/phpunit/changes/TestChanges.php
M lib/tests/phpunit/entity/EntityFactoryTest.php
M lib/tests/phpunit/formatters/GlobeCoordinateDetailsFormatterTest.php
M lib/tests/phpunit/formatters/HtmlExternalIdentifierFormatterTest.php
M lib/tests/phpunit/formatters/HtmlTimeFormatterTest.php
M lib/tests/phpunit/formatters/OutputFormatSnakFormatterFactoryTest.php
M lib/tests/phpunit/formatters/PropertyValueSnakFormatterTest.php
M lib/tests/phpunit/formatters/TimeDetailsFormatterTest.php
M lib/tests/phpunit/formatters/WikitextExternalIdentifierFormatterTest.php
M lib/tests/phpunit/store/EntityInfoTermLookupTest.php
M lib/tests/phpunit/store/RevisionBasedEntityLookupTest.php
M lib/tests/phpunit/store/Sql/ChangeLookupTest.php
M repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
M repo/tests/phpunit/includes/Api/ApiModuleTestHelper.php
M repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
M repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
M repo/tests/phpunit/includes/Api/GetClaimsStatementFilterTest.php
M repo/tests/phpunit/includes/Api/MergeItemsTest.php
M repo/tests/phpunit/includes/Api/ParseValueTest.php
M repo/tests/phpunit/includes/Api/SetQualifierTest.php
M repo/tests/phpunit/includes/BuilderBasedDataTypeValidatorFactoryTest.php
M repo/tests/phpunit/includes/ChangeDispatcherTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
M repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php
M repo/tests/phpunit/includes/Content/EntityContentTest.php
M repo/tests/phpunit/includes/Content/ItemHandlerTest.php
M repo/tests/phpunit/includes/Content/PropertyHandlerTest.php
M repo/tests/phpunit/includes/EditEntityTest.php
M repo/tests/phpunit/includes/GenericEventDispatcherTest.php
M repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
M repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
M repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
M repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php
M repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
M repo/tests/phpunit/includes/Rdf/RdfVocabularyTest.php
M repo/tests/phpunit/includes/SnakConstructionServiceTest.php
M repo/tests/phpunit/includes/StatementRankSerializerTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
M repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php
M repo/tests/phpunit/includes/Validators/TypeValidatorTest.php
M repo/tests/phpunit/includes/Validators/UrlSchemeValidatorsTest.php
66 files changed, 237 insertions(+), 168 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/11/277211/1

diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
index 3bcd735..b957717 100644
--- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
@@ -12,6 +12,7 @@
 use Wikibase\DataModel\SiteLink;
 use Wikibase\EntityChange;
 use Wikibase\EntityFactory;
+use Wikibase\ItemChange;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Test\MockRepository;
 use Wikibase\Test\TestChanges;
@@ -123,9 +124,9 @@
                $diff = $this->makeDiff( $values['object_id'], 
$values['info']['metadata']['parent_id'], $values[ 'revision_id' ] );
                $values['info'] = serialize( $values['info'] );
 
-               $class = 'Wikibase\EntityChange';
+               $class = EntityChange::class;
                if ( $values['type'] === 'wikibase-item~add' || $values['type'] 
=== 'wikibase-item~update' ) {
-                       $class = 'Wikibase\ItemChange';
+                       $class = ItemChange::class;
                }
 
                $change = new $class( $values );
@@ -157,7 +158,7 @@
 
        private function makeDiff( $objectId, $revA, $revB ) {
                $entityClasses = array(
-                       Item::ENTITY_TYPE => 'Wikibase\DataModel\Entity\Item',
+                       Item::ENTITY_TYPE => Item::class,
                );
 
                $lookup = $this->getEntityRevisionLookup();
diff --git a/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php 
b/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
index f19201c..fe8a6ab 100644
--- a/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
+++ b/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
@@ -151,7 +151,7 @@
                $jobQueueGroup = $this->getJobQueueGroupMock();
 
                $jobMatcher = function( Job $job ) use ( $title ) {
-                       PHPUnit_Framework_Assert::assertInstanceOf( 
'RefreshLinksJob', $job );
+                       PHPUnit_Framework_Assert::assertInstanceOf( 
RefreshLinksJob::class, $job );
                        PHPUnit_Framework_Assert::assertEquals(
                                $title->getPrefixedDBkey(),
                                $job->getTitle()->getPrefixedDBkey()
diff --git 
a/client/tests/phpunit/includes/DataAccess/PropertyIdResolverTest.php 
b/client/tests/phpunit/includes/DataAccess/PropertyIdResolverTest.php
index 74aa8c7..6d629c5 100644
--- a/client/tests/phpunit/includes/DataAccess/PropertyIdResolverTest.php
+++ b/client/tests/phpunit/includes/DataAccess/PropertyIdResolverTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Client\Tests\DataAccess;
 
 use Wikibase\Client\DataAccess\PropertyIdResolver;
+use Wikibase\Client\PropertyLabelNotResolvedException;
 use Wikibase\DataModel\Entity\Property;
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\Test\MockPropertyLabelResolver;
@@ -64,7 +65,7 @@
        public function testResolvePropertyIdWithInvalidInput_throwsException( 
$propertyIdOrLabel ) {
                $propertyIdResolver = $this->getPropertyIdResolver();
 
-               $this->setExpectedException( 
'Wikibase\Client\PropertyLabelNotResolvedException' );
+               $this->setExpectedException( 
PropertyLabelNotResolvedException::class );
 
                $propertyIdResolver->resolvePropertyId( $propertyIdOrLabel, 
'en' );
        }
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php 
b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
index bcdda57..4981380 100644
--- a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
+++ b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
@@ -134,7 +134,7 @@
         * @dataProvider provideZeroIndexedArray
         */
        public function testZeroIndexArray( array $array, array $expected ) {
-               $renumber = new ReflectionMethod( 
'Wikibase\Client\DataAccess\Scribunto\EntityAccessor', 'renumber' );
+               $renumber = new ReflectionMethod( EntityAccessor::class, 
'renumber' );
                $renumber->setAccessible( true );
                $renumber->invokeArgs( $this->getEntityAccessor(), array( 
&$array ) );
 
diff --git 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
index 3fc331d..b7a7c48 100644
--- 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
@@ -61,7 +61,7 @@
                        array()
                );
 
-               $this->setExpectedException( 
'Wikibase\Client\PropertyLabelNotResolvedException' );
+               $this->setExpectedException( 
PropertyLabelNotResolvedException::class );
                $renderer->render( new ItemId( 'Q42' ), 'blah' );
        }
 
diff --git a/client/tests/phpunit/includes/ForbiddenSerializerTest.php 
b/client/tests/phpunit/includes/ForbiddenSerializerTest.php
index e233f84..0820084 100644
--- a/client/tests/phpunit/includes/ForbiddenSerializerTest.php
+++ b/client/tests/phpunit/includes/ForbiddenSerializerTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Client\Tests;
 
 use PHPUnit_Framework_TestCase;
+use RuntimeException;
 use Wikibase\Client\ForbiddenSerializer;
 
 /**
@@ -19,7 +20,7 @@
        public function test() {
                $serializer = new ForbiddenSerializer( 'customMessage' );
 
-               $this->setExpectedException( 'RuntimeException', 
'customMessage' );
+               $this->setExpectedException( RuntimeException::class, 
'customMessage' );
                $serializer->serialize( null );
        }
 
diff --git 
a/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
 
b/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
index d9a7332..84b6526 100644
--- 
a/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
+++ 
b/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
@@ -85,7 +85,7 @@
                $repoItemLinkGenerator->expects( $this->any() )
                        ->method( 'getLink' )
                        ->with(
-                               $this->isInstanceOf( 'Title' ),
+                               $this->isInstanceOf( Title::class ),
                                $this->isType( 'string' ),
                                $this->isType( 'bool' ),
                                $this->logicalOr( $this->isType( 'array' ), 
$this->isNull() ),
diff --git a/client/tests/phpunit/includes/Store/Sql/DirectSqlStoreTest.php 
b/client/tests/phpunit/includes/Store/Sql/DirectSqlStoreTest.php
index db28b73..a89a281 100644
--- a/client/tests/phpunit/includes/Store/Sql/DirectSqlStoreTest.php
+++ b/client/tests/phpunit/includes/Store/Sql/DirectSqlStoreTest.php
@@ -2,9 +2,21 @@
 
 namespace Wikibase\Client\Tests\Store\Sql;
 
+use Wikibase\Client\RecentChanges\RecentChangesDuplicateDetector;
+use Wikibase\Client\Usage\SubscriptionManager;
+use Wikibase\Client\Usage\UsageLookup;
+use Wikibase\Client\Usage\UsageTracker;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\Services\Entity\EntityPrefetcher;
+use Wikibase\DataModel\Services\Lookup\EntityLookup;
+use Wikibase\DataModel\Services\Term\PropertyLabelResolver;
 use Wikibase\DirectSqlStore;
+use Wikibase\Lib\Store\ChangeLookup;
+use Wikibase\Lib\Store\SiteLinkLookup;
+use Wikibase\PropertyInfoStore;
+use Wikibase\Store\EntityIdLookup;
+use Wikibase\TermIndex;
 
 /**
  * @covers Wikibase\DirectSqlStore
@@ -48,18 +60,18 @@
 
        public function provideGetters() {
                return array(
-                       array( 'getSiteLinkLookup', 
'Wikibase\Lib\Store\SiteLinkLookup' ),
-                       array( 'getEntityLookup', 
'Wikibase\DataModel\Services\Lookup\EntityLookup' ),
-                       array( 'getTermIndex', 'Wikibase\TermIndex' ),
-                       array( 'getPropertyLabelResolver', 
'Wikibase\DataModel\Services\Term\PropertyLabelResolver' ),
-                       array( 'getPropertyInfoStore', 
'Wikibase\PropertyInfoStore' ),
-                       array( 'getUsageTracker', 
'Wikibase\Client\Usage\UsageTracker' ),
-                       array( 'getUsageLookup', 
'Wikibase\Client\Usage\UsageLookup' ),
-                       array( 'getSubscriptionManager', 
'Wikibase\Client\Usage\SubscriptionManager', true ),
-                       array( 'getEntityIdLookup', 
'Wikibase\Store\EntityIdLookup' ),
-                       array( 'getEntityPrefetcher', 
'Wikibase\DataModel\Services\Entity\EntityPrefetcher' ),
-                       array( 'getChangeLookup', 
'Wikibase\Lib\Store\ChangeLookup' ),
-                       array( 'getRecentChangesDuplicateDetector', 
'Wikibase\Client\RecentChanges\RecentChangesDuplicateDetector' ),
+                       array( 'getSiteLinkLookup', SiteLinkLookup::class ),
+                       array( 'getEntityLookup', EntityLookup::class ),
+                       array( 'getTermIndex', TermIndex::class ),
+                       array( 'getPropertyLabelResolver', 
PropertyLabelResolver::class ),
+                       array( 'getPropertyInfoStore', PropertyInfoStore::class 
),
+                       array( 'getUsageTracker', UsageTracker::class ),
+                       array( 'getUsageLookup', UsageLookup::class ),
+                       array( 'getSubscriptionManager', 
SubscriptionManager::class, true ),
+                       array( 'getEntityIdLookup', EntityIdLookup::class ),
+                       array( 'getEntityPrefetcher', EntityPrefetcher::class ),
+                       array( 'getChangeLookup', ChangeLookup::class ),
+                       array( 'getRecentChangesDuplicateDetector', 
RecentChangesDuplicateDetector::class ),
                );
        }
 
diff --git a/client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php 
b/client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php
index d347e03..8b66117 100644
--- a/client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php
+++ b/client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php
@@ -125,7 +125,7 @@
 
                $actual = $lookup->getPagesUsing( array( $q23 ), array( 
EntityUsage::OTHER_USAGE ) );
                $this->assertInstanceOf( Traversable::class, $actual );
-               $this->assertContainsOnlyInstancesOf( 
'Wikibase\Client\Usage\PageEntityUsages', $actual );
+               $this->assertContainsOnlyInstancesOf( PageEntityUsages::class, 
$actual );
                $this->assertCount( 1, $actual );
 
                /** @var PageEntityUsages[] $actual */
@@ -134,7 +134,7 @@
 
                $usages = $pageUsageObject->getUsages();
                $this->assertInternalType( 'array', $usages );
-               $this->assertContainsOnlyInstancesOf( 
'Wikibase\Client\Usage\EntityUsage', $usages );
+               $this->assertContainsOnlyInstancesOf( EntityUsage::class, 
$usages );
                $this->assertCount( 1, $usages );
 
                $usage = reset( $usages );
@@ -143,7 +143,7 @@
 
                $actual = $lookup->getPagesUsing( array( $q42, $q23, $p11 ) );
                $this->assertInstanceOf( Traversable::class, $actual );
-               $this->assertContainsOnlyInstancesOf( 
'Wikibase\Client\Usage\PageEntityUsages', $actual );
+               $this->assertContainsOnlyInstancesOf( PageEntityUsages::class, 
$actual );
                $this->assertCount( 1, $actual );
 
                $pageUsageObject = $actual[0];
@@ -151,7 +151,7 @@
 
                $usages = $pageUsageObject->getUsages();
                $this->assertInternalType( 'array', $usages );
-               $this->assertContainsOnlyInstancesOf( 
'Wikibase\Client\Usage\EntityUsage', $usages );
+               $this->assertContainsOnlyInstancesOf( EntityUsage::class, 
$usages );
                $this->assertCount( 1, $usages );
 
                $usage = reset( $usages );
diff --git a/lib/tests/phpunit/EntityRevisionLookupTest.php 
b/lib/tests/phpunit/EntityRevisionLookupTest.php
index 0d3a8c9..71455f7 100644
--- a/lib/tests/phpunit/EntityRevisionLookupTest.php
+++ b/lib/tests/phpunit/EntityRevisionLookupTest.php
@@ -11,6 +11,7 @@
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
+use Wikibase\Lib\Store\StorageException;
 
 /**
  * Base class for testing EntityRevisionLookup implementations
@@ -92,13 +93,13 @@
                                new ItemId( 'q42' ), 12, true,
                        ),
                        array( // #3: bad revision
-                               new ItemId( 'q42' ), 600000, false, 
'Wikibase\Lib\Store\StorageException',
+                               new ItemId( 'q42' ), 600000, false, 
StorageException::class,
                        ),
                        array( // #4: wrong type
                                new ItemId( 'q753' ), 
EntityRevisionLookup::LATEST_FROM_SLAVE, false,
                        ),
                        array( // #5: mismatching revision
-                               new PropertyId( 'p753' ), 11, false, 
'Wikibase\Lib\Store\StorageException',
+                               new PropertyId( 'p753' ), 11, false, 
StorageException::class,
                        ),
                        array( // #6: some revision
                                new PropertyId( 'p753' ), 
EntityRevisionLookup::LATEST_FROM_SLAVE, true,
diff --git a/lib/tests/phpunit/MockRepositoryTest.php 
b/lib/tests/phpunit/MockRepositoryTest.php
index 7ed1052..270ce42 100644
--- a/lib/tests/phpunit/MockRepositoryTest.php
+++ b/lib/tests/phpunit/MockRepositoryTest.php
@@ -11,9 +11,11 @@
 use Wikibase\DataModel\Entity\Property;
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException;
 use Wikibase\DataModel\SiteLink;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
+use Wikibase\Lib\Store\StorageException;
 
 /**
  * @covers Wikibase\Test\MockRepository
@@ -447,21 +449,21 @@
                                'entity' => $thirdItem,
                                'flags' => EDIT_NEW,
                                'baseRevid' => false,
-                               'error' => 'Wikibase\Lib\Store\StorageException'
+                               'error' => StorageException::class
                        ),
 
                        'not exists' => array(
                                'entity' => $fourthItem,
                                'flags' => EDIT_UPDATE,
                                'baseRevid' => false,
-                               'error' => 
'Wikibase\Lib\Store\\StorageException'
+                               'error' => StorageException::class
                        ),
 
                        'bad base' => array(
                                'entity' => $fifthItem,
                                'flags' => EDIT_UPDATE,
                                'baseRevid' => 1234,
-                               'error' => 
'Wikibase\Lib\Store\\StorageException'
+                               'error' => StorageException::class
                        ),
                );
        }
@@ -513,7 +515,7 @@
                $this->assertEquals( 
$redirect->getEntityId()->getSerialization(), $logEntry['entity'] );
                $this->assertEquals( 'redirected Q10 to Q1', 
$logEntry['summary'] );
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\RevisionedUnresolvedRedirectException' );
+               $this->setExpectedException( 
RevisionedUnresolvedRedirectException::class );
                $this->repo->getEntity( $q10 );
        }
 
@@ -601,7 +603,7 @@
                $redirect = new EntityRedirect( new ItemId( 'Q11' ), new 
ItemId( 'Q1' ) );
                $this->repo->putRedirect( $redirect );
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\RevisionedUnresolvedRedirectException' );
+               $this->setExpectedException( 
RevisionedUnresolvedRedirectException::class );
                $this->repo->deleteEntity( $redirect->getEntityId(), 'testing', 
$GLOBALS['wgUser'] );
        }
 
@@ -698,7 +700,7 @@
                $this->assertNull( $mock->getRedirectForEntityId( $q5 ), 'not a 
redirect' );
                $this->assertEquals( $q5, $mock->getRedirectForEntityId( $q55 ) 
);
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException' );
+               $this->setExpectedException( 
EntityRedirectLookupException::class );
                $mock->getRedirectForEntityId( $q77 );
        }
 
diff --git a/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php 
b/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php
index d4e0f12..930f6e7 100644
--- a/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php
+++ b/lib/tests/phpunit/PropertyInfoDataTypeLookupTest.php
@@ -6,6 +6,7 @@
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Services\Lookup\EntityRetrievingDataTypeLookup;
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
+use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException;
 use Wikibase\Lib\PropertyInfoDataTypeLookup;
 use Wikibase\PropertyInfoStore;
 use Wikibase\Test\MockPropertyInfoStore;
@@ -103,7 +104,7 @@
                $expectedDataType
        ) {
                if ( $expectedDataType === false ) {
-                       $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException' );
+                       $this->setExpectedException( 
PropertyDataTypeLookupException::class );
                }
 
                $lookup = new PropertyInfoDataTypeLookup( $infoStore, 
$fallbackLookup );
diff --git a/lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php 
b/lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php
index e815931..e3baca4 100644
--- a/lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php
+++ b/lib/tests/phpunit/PropertyInfoSnakUrlExpanderTest.php
@@ -11,6 +11,7 @@
 use Wikibase\Lib\PropertyInfoSnakUrlExpander;
 use Wikibase\PropertyInfoStore;
 use Wikibase\Test\MockPropertyInfoStore;
+use Wikimedia\Assert\ParameterTypeException;
 
 /**
  * @covers Wikibase\Lib\PropertyInfoSnakUrlExpander
@@ -137,7 +138,7 @@
                );
                $urlExpander = new PropertyInfoSnakUrlExpander( $infoProvider );
 
-               $this->setExpectedException( 
'Wikimedia\Assert\ParameterTypeException' );
+               $this->setExpectedException( ParameterTypeException::class );
                $urlExpander->expandUrl( $snak );
        }
 
diff --git a/lib/tests/phpunit/TermIndexEntryTest.php 
b/lib/tests/phpunit/TermIndexEntryTest.php
index 5b17584..fd3e350 100644
--- a/lib/tests/phpunit/TermIndexEntryTest.php
+++ b/lib/tests/phpunit/TermIndexEntryTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Test;
 
+use MWException;
 use PHPUnit_Framework_TestCase;
 use Wikibase\DataModel\LegacyIdInterpreter;
 use Wikibase\DataModel\Term\Term;
@@ -202,7 +203,7 @@
         */
        public function testGetTerm_throwsException( $termIndexEntryData ) {
                $termIndexEntry = new TermIndexEntry( $termIndexEntryData );
-               $this->setExpectedException( 'MWException', 'Can not construct 
Term from partial TermIndexEntry' );
+               $this->setExpectedException( MWException::class, 'Can not 
construct Term from partial TermIndexEntry' );
                $termIndexEntry->getTerm();
        }
 
diff --git a/lib/tests/phpunit/changes/EntityChangeFactoryTest.php 
b/lib/tests/phpunit/changes/EntityChangeFactoryTest.php
index 0b46d18..01556ce 100644
--- a/lib/tests/phpunit/changes/EntityChangeFactoryTest.php
+++ b/lib/tests/phpunit/changes/EntityChangeFactoryTest.php
@@ -16,6 +16,7 @@
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\EntityChange;
 use Wikibase\EntityFactory;
+use Wikibase\ItemChange;
 use Wikibase\Lib\Changes\EntityChangeFactory;
 
 /**
@@ -39,12 +40,12 @@
         */
        public function getEntityChangeFactory() {
                $entityClasses = array(
-                       Item::ENTITY_TYPE => 'Wikibase\DataModel\Entity\Item',
-                       Property::ENTITY_TYPE => 
'Wikibase\DataModel\Entity\Property',
+                       Item::ENTITY_TYPE => Item::class,
+                       Property::ENTITY_TYPE => Property::class,
                );
 
                $changeClasses = array(
-                       Item::ENTITY_TYPE => 'Wikibase\ItemChange',
+                       Item::ENTITY_TYPE => ItemChange::class,
                );
 
                $factory = new EntityChangeFactory(
@@ -58,8 +59,8 @@
 
        public function newForEntityProvider() {
                return array(
-                       'add item' => array( EntityChange::ADD, new ItemId( 
'Q17' ), 'Wikibase\ItemChange' ),
-                       'remove property' => array( EntityChange::REMOVE, new 
PropertyId( 'P17' ), 'Wikibase\EntityChange' ),
+                       'add item' => array( EntityChange::ADD, new ItemId( 
'Q17' ), ItemChange::class ),
+                       'remove property' => array( EntityChange::REMOVE, new 
PropertyId( 'P17' ), EntityChange::class ),
                );
        }
 
diff --git a/lib/tests/phpunit/changes/EntityChangeTest.php 
b/lib/tests/phpunit/changes/EntityChangeTest.php
index 2ec3baf..16eb1fa 100644
--- a/lib/tests/phpunit/changes/EntityChangeTest.php
+++ b/lib/tests/phpunit/changes/EntityChangeTest.php
@@ -40,7 +40,7 @@
         * @return string
         */
        protected function getRowClass() {
-               return 'Wikibase\EntityChange';
+               return EntityChange::class;
        }
 
        protected function newEntityChange( EntityId $entityId ) {
@@ -328,7 +328,7 @@
                        ),
                        'type' => 'statement',
                        'rank' => 'normal',
-                       '_claimclass_' => 
'Wikibase\DataModel\Statement\Statement',
+                       '_claimclass_' => Statement::class,
                );
 
                $change = new EntityChange();
@@ -354,7 +354,7 @@
                                'property' => 'P1',
                        ),
                        'type' => 'statement',
-                       '_claimclass_' => 
'Wikibase\DataModel\Statement\Statement',
+                       '_claimclass_' => Statement::class,
                );
 
                $change = new EntityChange();
diff --git a/lib/tests/phpunit/changes/ItemChangeTest.php 
b/lib/tests/phpunit/changes/ItemChangeTest.php
index 21d00e3..34312b0 100644
--- a/lib/tests/phpunit/changes/ItemChangeTest.php
+++ b/lib/tests/phpunit/changes/ItemChangeTest.php
@@ -32,7 +32,7 @@
         * @return string
         */
        protected function getRowClass() {
-               return 'Wikibase\ItemChange';
+               return ItemChange::class;
        }
 
        public function entityProvider() {
diff --git a/lib/tests/phpunit/changes/TestChanges.php 
b/lib/tests/phpunit/changes/TestChanges.php
index 489ce37..e2e4650 100644
--- a/lib/tests/phpunit/changes/TestChanges.php
+++ b/lib/tests/phpunit/changes/TestChanges.php
@@ -16,6 +16,7 @@
 use Wikibase\DiffChange;
 use Wikibase\EntityChange;
 use Wikibase\EntityFactory;
+use Wikibase\ItemChange;
 use Wikibase\Lib\Changes\EntityChangeFactory;
 
 /**
@@ -60,12 +61,12 @@
         */
        public static function getEntityChangeFactory() {
                $entityClasses = array(
-                       Item::ENTITY_TYPE => 'Wikibase\DataModel\Entity\Item',
-                       Property::ENTITY_TYPE => 
'Wikibase\DataModel\Entity\Property',
+                       Item::ENTITY_TYPE => Item::class,
+                       Property::ENTITY_TYPE => Property::class,
                );
 
                $changeClasses = array(
-                       Item::ENTITY_TYPE => 'Wikibase\ItemChange',
+                       Item::ENTITY_TYPE => ItemChange::class,
                );
 
                $factory = new EntityChangeFactory(
diff --git a/lib/tests/phpunit/entity/EntityFactoryTest.php 
b/lib/tests/phpunit/entity/EntityFactoryTest.php
index 67ca4c5..fdfe99e 100644
--- a/lib/tests/phpunit/entity/EntityFactoryTest.php
+++ b/lib/tests/phpunit/entity/EntityFactoryTest.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase\Test;
 
+use Wikibase\DataModel\Entity\Item;
+use Wikibase\DataModel\Entity\Property;
 use Wikibase\EntityFactory;
 
 /**
@@ -18,8 +20,8 @@
 
        private function getEntityFactory() {
                return new EntityFactory( array(
-                       'item' => 'Wikibase\DataModel\Entity\Item',
-                       'property' => 'Wikibase\DataModel\Entity\Property',
+                       'item' => Item::class,
+                       'property' => Property::class,
                ) );
        }
 
@@ -56,8 +58,8 @@
 
        public function provideNewEmpty() {
                return array(
-                       array( 'item', 'Wikibase\DataModel\Entity\Item' ),
-                       array( 'property', 'Wikibase\DataModel\Entity\Property' 
),
+                       array( 'item', Item::class ),
+                       array( 'property', Property::class ),
                );
        }
 
diff --git 
a/lib/tests/phpunit/formatters/GlobeCoordinateDetailsFormatterTest.php 
b/lib/tests/phpunit/formatters/GlobeCoordinateDetailsFormatterTest.php
index cfd47fd..e9ca627 100644
--- a/lib/tests/phpunit/formatters/GlobeCoordinateDetailsFormatterTest.php
+++ b/lib/tests/phpunit/formatters/GlobeCoordinateDetailsFormatterTest.php
@@ -64,7 +64,7 @@
 
        public function testEscaping() {
                $value = $this->getMock(
-                       'DataValues\Geo\Values\GlobeCoordinateValue',
+                       GlobeCoordinateValue::class,
                        array( 'getLatitude', 'getLongitude', 'getPrecision' ),
                        array( new LatLongValue( 0, 0 ), null, '<GLOBE>' )
                );
diff --git 
a/lib/tests/phpunit/formatters/HtmlExternalIdentifierFormatterTest.php 
b/lib/tests/phpunit/formatters/HtmlExternalIdentifierFormatterTest.php
index ff83a7a..e645266 100644
--- a/lib/tests/phpunit/formatters/HtmlExternalIdentifierFormatterTest.php
+++ b/lib/tests/phpunit/formatters/HtmlExternalIdentifierFormatterTest.php
@@ -9,6 +9,7 @@
 use Wikibase\Lib\Formatters\HtmlExternalIdentifierFormatter;
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Lib\SnakUrlExpander;
+use Wikimedia\Assert\ParameterTypeException;
 
 /**
  * @covers Wikibase\Lib\Formatters\HtmlExternalIdentifierFormatter
@@ -80,7 +81,7 @@
                $urlExpander = $this->getMock( SnakUrlExpander::class );
                $formatter = new HtmlExternalIdentifierFormatter( $urlExpander 
);
 
-               $this->setExpectedException( 
'Wikimedia\Assert\ParameterTypeException' );
+               $this->setExpectedException( ParameterTypeException::class );
                $formatter->formatSnak( $snak );
        }
 
diff --git a/lib/tests/phpunit/formatters/HtmlTimeFormatterTest.php 
b/lib/tests/phpunit/formatters/HtmlTimeFormatterTest.php
index 29e27ee..a48811e 100644
--- a/lib/tests/phpunit/formatters/HtmlTimeFormatterTest.php
+++ b/lib/tests/phpunit/formatters/HtmlTimeFormatterTest.php
@@ -50,7 +50,7 @@
        private function getTimeValue( $timestamp, $precision, $calendarModel ) 
{
                $value = new TimeValue( '+1-00-00T00:00:00Z', 0, 0, 0, 
TimeValue::PRECISION_YEAR, $calendarModel );
 
-               $class = new \ReflectionClass( 'DataValues\TimeValue' );
+               $class = new \ReflectionClass( TimeValue::class );
 
                $timestampProperty = $class->getProperty( 'timestamp' );
                $timestampProperty->setAccessible( true );
diff --git 
a/lib/tests/phpunit/formatters/OutputFormatSnakFormatterFactoryTest.php 
b/lib/tests/phpunit/formatters/OutputFormatSnakFormatterFactoryTest.php
index ae26bd0..a13ae68 100644
--- a/lib/tests/phpunit/formatters/OutputFormatSnakFormatterFactoryTest.php
+++ b/lib/tests/phpunit/formatters/OutputFormatSnakFormatterFactoryTest.php
@@ -14,6 +14,8 @@
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Snak\Snak;
 use Wikibase\LanguageFallbackChainFactory;
+use Wikibase\Lib\DispatchingSnakFormatter;
+use Wikibase\Lib\Formatters\ErrorHandlingSnakFormatter;
 use Wikibase\Lib\OutputFormatSnakFormatterFactory;
 use Wikibase\Lib\OutputFormatValueFormatterFactory;
 use Wikibase\Lib\SnakFormatter;
@@ -157,15 +159,15 @@
                return array(
                        'default' => array(
                                array(),
-                               
'Wikibase\Lib\Formatters\ErrorHandlingSnakFormatter'
+                               ErrorHandlingSnakFormatter::class
                        ),
                        'OPT_ON_ERROR => ON_ERROR_WARN' => array(
                                array( SnakFormatter::OPT_ON_ERROR => 
SnakFormatter::ON_ERROR_WARN ),
-                               
'Wikibase\Lib\Formatters\ErrorHandlingSnakFormatter'
+                               ErrorHandlingSnakFormatter::class
                        ),
                        'OPT_ON_ERROR => ON_ERROR_FAIL' => array(
                                array( SnakFormatter::OPT_ON_ERROR => 
SnakFormatter::ON_ERROR_FAIL ),
-                               'Wikibase\Lib\DispatchingSnakFormatter'
+                               DispatchingSnakFormatter::class
                        ),
                );
        }
diff --git a/lib/tests/phpunit/formatters/PropertyValueSnakFormatterTest.php 
b/lib/tests/phpunit/formatters/PropertyValueSnakFormatterTest.php
index 9e55187..cf24c53 100644
--- a/lib/tests/phpunit/formatters/PropertyValueSnakFormatterTest.php
+++ b/lib/tests/phpunit/formatters/PropertyValueSnakFormatterTest.php
@@ -7,7 +7,9 @@
 use DataValues\StringValue;
 use DataValues\UnDeserializableValue;
 use OutOfBoundsException;
+use ValueFormatters\Exceptions\MismatchingDataValueTypeException;
 use ValueFormatters\FormatterOptions;
+use ValueFormatters\FormattingException;
 use ValueFormatters\StringFormatter;
 use ValueFormatters\ValueFormatter;
 use Wikibase\DataModel\Entity\PropertyId;
@@ -183,7 +185,7 @@
                                SnakFormatter::FORMAT_HTML,
                                $dispatchingFormatter,
                                null,
-                               
'ValueFormatters\Exceptions\MismatchingDataValueTypeException'
+                               MismatchingDataValueTypeException::class
                        ),
 
                        'VT mismatching PT, fail' => array(
@@ -193,7 +195,7 @@
                                SnakFormatter::FORMAT_WIKI,
                                $dispatchingFormatter,
                                null,
-                               
'ValueFormatters\Exceptions\MismatchingDataValueTypeException'
+                               MismatchingDataValueTypeException::class
                        ),
 
                        'property not found, fail' => array(
@@ -203,7 +205,7 @@
                                SnakFormatter::FORMAT_HTML,
                                $dispatchingFormatter,
                                null,
-                               
'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException'
+                               PropertyDataTypeLookupException::class
                        ),
 
                        'data type not found, fail' => array(
@@ -213,7 +215,7 @@
                                SnakFormatter::FORMAT_HTML,
                                $dispatchingFormatter,
                                null,
-                               'ValueFormatters\FormattingException'
+                               FormattingException::class
                        ),
                );
        }
diff --git a/lib/tests/phpunit/formatters/TimeDetailsFormatterTest.php 
b/lib/tests/phpunit/formatters/TimeDetailsFormatterTest.php
index 2c501a2..040ebc2 100644
--- a/lib/tests/phpunit/formatters/TimeDetailsFormatterTest.php
+++ b/lib/tests/phpunit/formatters/TimeDetailsFormatterTest.php
@@ -60,7 +60,7 @@
        ) {
                $value = new TimeValue( '+1-00-00T00:00:00Z', 0, 0, 0, 
TimeValue::PRECISION_YEAR, $calendarModel );
 
-               $class = new \ReflectionClass( 'DataValues\TimeValue' );
+               $class = new \ReflectionClass( TimeValue::class );
 
                $timestampProperty = $class->getProperty( 'timestamp' );
                $timestampProperty->setAccessible( true );
diff --git 
a/lib/tests/phpunit/formatters/WikitextExternalIdentifierFormatterTest.php 
b/lib/tests/phpunit/formatters/WikitextExternalIdentifierFormatterTest.php
index a0f2b5d..aa75d34 100644
--- a/lib/tests/phpunit/formatters/WikitextExternalIdentifierFormatterTest.php
+++ b/lib/tests/phpunit/formatters/WikitextExternalIdentifierFormatterTest.php
@@ -9,6 +9,7 @@
 use Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter;
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Lib\SnakUrlExpander;
+use Wikimedia\Assert\ParameterTypeException;
 
 /**
  * @covers Wikibase\Lib\Formatters\WikitextExternalIdentifierFormatter
@@ -88,7 +89,7 @@
                $urlExpander = $this->getMock( SnakUrlExpander::class );
                $formatter = new WikitextExternalIdentifierFormatter( 
$urlExpander );
 
-               $this->setExpectedException( 
'Wikimedia\Assert\ParameterTypeException' );
+               $this->setExpectedException( ParameterTypeException::class );
                $formatter->formatSnak( $snak );
        }
 
diff --git a/lib/tests/phpunit/store/EntityInfoTermLookupTest.php 
b/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
index 234c879..01985c8 100644
--- a/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
+++ b/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
@@ -4,6 +4,7 @@
 
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\ItemId;
+use Wikibase\DataModel\Services\Lookup\TermLookupException;
 use Wikibase\Lib\Store\EntityInfo;
 use Wikibase\Lib\Store\EntityInfoTermLookup;
 
@@ -35,7 +36,7 @@
        public function testWhenEntityNotFound_getLabelThrowsException() {
                $termLookup = $this->getEntityInfoTermLookup();
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\TermLookupException' );
+               $this->setExpectedException( TermLookupException::class );
                $termLookup->getLabel( new ItemId( 'Q90000' ), 'en' );
        }
 
@@ -72,7 +73,7 @@
        public function testGetLabels_noEntityThrowsException() {
                $termLookup = $this->getEntityInfoTermLookup();
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\TermLookupException' );
+               $this->setExpectedException( TermLookupException::class );
                $termLookup->getLabels( new ItemId( 'Q90000' ), array( 'x' ) );
        }
 
@@ -93,7 +94,7 @@
        public function testWhenEntityNotFound_getDescriptionThrowsException() {
                $termLookup = $this->getEntityInfoTermLookup();
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\TermLookupException' );
+               $this->setExpectedException( TermLookupException::class );
                $termLookup->getDescription( new ItemId( 'Q90000' ), 'en' );
        }
 
@@ -135,7 +136,7 @@
        public function testGetDescriptions_noEntityThrowsException() {
                $termLookup = $this->getEntityInfoTermLookup();
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\TermLookupException' );
+               $this->setExpectedException( TermLookupException::class );
                $termLookup->getDescriptions( new ItemId( 'Q90000' ), array( 
'x' ) );
        }
 
diff --git a/lib/tests/phpunit/store/RevisionBasedEntityLookupTest.php 
b/lib/tests/phpunit/store/RevisionBasedEntityLookupTest.php
index 3920480..7e7d2cf 100644
--- a/lib/tests/phpunit/store/RevisionBasedEntityLookupTest.php
+++ b/lib/tests/phpunit/store/RevisionBasedEntityLookupTest.php
@@ -5,6 +5,7 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
+use Wikibase\DataModel\Services\Lookup\EntityLookupException;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\RevisionBasedEntityLookup;
 use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
@@ -85,7 +86,7 @@
        public function 
testWhenEntityLookupExceptionIsThrown_getEntityPassesItAlong() {
                $entityLookup = new RevisionBasedEntityLookup( 
$this->newEntityLookupExceptionThrowingRevisionLookup() );
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\RevisionedUnresolvedRedirectException' );
+               $this->setExpectedException( 
RevisionedUnresolvedRedirectException::class );
                $entityLookup->getEntity( new ItemId( 'Q1' ) );
        }
 
@@ -115,14 +116,14 @@
        public function 
testWhenEntityLookupExceptionIsThrown_hasEntityPassesItAlong() {
                $entityLookup = new RevisionBasedEntityLookup( 
$this->newEntityLookupExceptionThrowingRevisionLookup() );
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\RevisionedUnresolvedRedirectException' );
+               $this->setExpectedException( 
RevisionedUnresolvedRedirectException::class );
                $entityLookup->hasEntity( new ItemId( 'Q1' ) );
        }
 
        public function 
testWhenBadExceptionIsThrown_hasEntityRethrowsAsEntityLookupException() {
                $entityLookup = new RevisionBasedEntityLookup( 
$this->newBadExceptionThrowingRevisionLookup() );
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\EntityLookupException' );
+               $this->setExpectedException( EntityLookupException::class );
                $entityLookup->hasEntity( new ItemId( 'Q1' ) );
        }
 
@@ -146,7 +147,7 @@
        public function 
testWhenBadExceptionIsThrown_getEntityRethrowsAsEntityLookupException() {
                $entityLookup = new RevisionBasedEntityLookup( 
$this->newBadExceptionThrowingRevisionLookup() );
 
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\EntityLookupException' );
+               $this->setExpectedException( EntityLookupException::class );
                $entityLookup->getEntity( new ItemId( 'Q1' ) );
        }
 
diff --git a/lib/tests/phpunit/store/Sql/ChangeLookupTest.php 
b/lib/tests/phpunit/store/Sql/ChangeLookupTest.php
index 016f2a3..fcd8337 100644
--- a/lib/tests/phpunit/store/Sql/ChangeLookupTest.php
+++ b/lib/tests/phpunit/store/Sql/ChangeLookupTest.php
@@ -72,7 +72,7 @@
                $start = $this->offsetStart( $start );
 
                $lookup = new ChangeLookup(
-                       array( 'wikibase-item~remove' => 
'Wikibase\EntityChange' ),
+                       array( 'wikibase-item~remove' => EntityChange::class ),
                        wfWikiID()
                );
 
@@ -88,7 +88,7 @@
                $start = $this->offsetStart( 3 );
 
                $lookup = new ChangeLookup(
-                       array( 'wikibase-item~remove' => 
'Wikibase\EntityChange' ),
+                       array( 'wikibase-item~remove' => EntityChange::class ),
                        wfWikiID()
                );
 
@@ -117,7 +117,7 @@
                $changeStore->saveChange( $expected );
 
                $lookup = new ChangeLookup(
-                       array( 'wikibase-item~remove' => 
'Wikibase\EntityChange' ),
+                       array( 'wikibase-item~remove' => EntityChange::class ),
                        wfWikiID()
                );
 
@@ -135,7 +135,7 @@
                }
 
                $lookup = new ChangeLookup(
-                       array( 'wikibase-item~remove' => 
'Wikibase\EntityChange' ),
+                       array( 'wikibase-item~remove' => EntityChange::class ),
                        wfWikiID()
                );
 
diff --git a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php 
b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
index b41852f..7afffea 100644
--- a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
+++ b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
@@ -3,6 +3,8 @@
 namespace Wikibase\Test\Repo\Api;
 
 use ApiBase;
+use Wikibase\Repo\Api\GetEntities;
+use Wikibase\Repo\Api\SetLabel;
 
 /**
  * @group API
@@ -103,7 +105,7 @@
                        'ids' => $entityId
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\GetEntities', 'wbgetentities', $params );
+               $module = $this->getApiModule( GetEntities::class, 
'wbgetentities', $params );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -121,7 +123,7 @@
                        'value' => 'enGbLabel',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetLabel', 
'wbsetlabel', $params, true );
+               $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -134,7 +136,7 @@
                        'value' => '',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetLabel', 
'wbsetlabel', $params, true );
+               $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
diff --git a/repo/tests/phpunit/includes/Api/ApiModuleTestHelper.php 
b/repo/tests/phpunit/includes/Api/ApiModuleTestHelper.php
index 2fd3780..cdf4b89 100644
--- a/repo/tests/phpunit/includes/Api/ApiModuleTestHelper.php
+++ b/repo/tests/phpunit/includes/Api/ApiModuleTestHelper.php
@@ -63,7 +63,7 @@
         * @param Exception $ex
         */
        public function assertUsageException( $expected, Exception $ex ) {
-               Assert::assertInstanceOf( 'UsageException', $ex );
+               Assert::assertInstanceOf( UsageException::class, $ex );
                /** @var UsageException $ex */
 
                if ( is_string( $expected ) ) {
diff --git a/repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php 
b/repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php
index 27c966d..039b506 100644
--- a/repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php
+++ b/repo/tests/phpunit/includes/Api/ApiXmlFormatTest.php
@@ -7,6 +7,15 @@
 use DOMXPath;
 use HashSiteStore;
 use TestSites;
+use Wikibase\Repo\Api\EditEntity;
+use Wikibase\Repo\Api\GetClaims;
+use Wikibase\Repo\Api\GetEntities;
+use Wikibase\Repo\Api\SetAliases;
+use Wikibase\Repo\Api\SetClaim;
+use Wikibase\Repo\Api\SetDescription;
+use Wikibase\Repo\Api\SetLabel;
+use Wikibase\Repo\Api\SetQualifier;
+use Wikibase\Repo\Api\SetReference;
 use Wikibase\Repo\Api\SetSiteLink;
 use Wikibase\Repo\SiteLinkTargetProvider;
 
@@ -33,7 +42,7 @@
                        'ids' => $entityId
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\GetEntities', 'wbgetentities', $params );
+               $module = $this->getApiModule( GetEntities::class, 
'wbgetentities', $params );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -49,7 +58,7 @@
                        'entity' => $entityId
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\GetClaims', 
'wbgetclaims', $params );
+               $module = $this->getApiModule( GetClaims::class, 'wbgetclaims', 
$params );
                $actual = $this->executeApiModule( $module );
 
                $this->assertXmlStringEqualsXmlString( $this->getExpectedXml( 
'getclaims' ), $actual );
@@ -66,7 +75,7 @@
                        'value' => 'enGbLabel',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetLabel', 
'wbsetlabel', $params, true );
+               $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -79,7 +88,7 @@
                        'value' => '',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetLabel', 
'wbsetlabel', $params, true );
+               $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -97,7 +106,7 @@
                        'value' => 'enGbDescription',
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetDescription', 'wbsetdescription', $params, true );
+               $module = $this->getApiModule( SetDescription::class, 
'wbsetdescription', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -110,7 +119,7 @@
                        'value' => '',
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetDescription', 'wbsetdescription', $params, true );
+               $module = $this->getApiModule( SetDescription::class, 
'wbsetdescription', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -128,7 +137,7 @@
                        'set' => 'AA|BB|CC',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetAliases', 
'wbsetaliases', $params, true );
+               $module = $this->getApiModule( SetAliases::class, 
'wbsetaliases', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -141,7 +150,7 @@
                        'remove' => 'BB|CC',
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetAliases', 
'wbsetaliases', $params, true );
+               $module = $this->getApiModule( SetAliases::class, 
'wbsetaliases', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
 
@@ -161,7 +170,7 @@
                );
 
                /** @var SetSiteLink $module */
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetSiteLink', 'wbsetsitelink', $params, true );
+               $module = $this->getApiModule( SetSiteLink::class, 
'wbsetsitelink', $params, true );
                $siteTargetProvider = new SiteLinkTargetProvider( new 
HashSiteStore( TestSites::getSites() ), array() );
                $module->setServices( $siteTargetProvider );
                $result = $this->executeApiModule( $module );
@@ -179,7 +188,7 @@
                );
 
                /** @var SetSiteLink $module */
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetSiteLink', 'wbsetsitelink', $params, true );
+               $module = $this->getApiModule( SetSiteLink::class, 
'wbsetsitelink', $params, true );
                $module->setServices( $siteTargetProvider );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
@@ -197,7 +206,7 @@
                        'claim' => $json,
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\SetClaim', 
'wbsetclaim', $params, true );
+               $module = $this->getApiModule( SetClaim::class, 'wbsetclaim', 
$params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result );
 
@@ -216,7 +225,7 @@
                        'snaks' => $json,
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetReference', 'wbsetreference', $params, true );
+               $module = $this->getApiModule( SetReference::class, 
'wbsetreference', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result );
                $actual = $this->replaceHashWithMock( $actual );
@@ -236,7 +245,7 @@
                        'snaktype' => 'value',
                );
 
-               $module = $this->getApiModule( 
'\Wikibase\Repo\Api\SetQualifier', 'wbsetqualifier', $params, true );
+               $module = $this->getApiModule( SetQualifier::class, 
'wbsetqualifier', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result );
                $actual = $this->replaceHashWithMock( $actual );
@@ -258,7 +267,7 @@
                        'data' => $json,
                );
 
-               $module = $this->getApiModule( '\Wikibase\Repo\Api\EditEntity', 
'wbeditEntity', $params, true );
+               $module = $this->getApiModule( EditEntity::class, 
'wbeditEntity', $params, true );
                $result = $this->executeApiModule( $module );
                $actual = $this->removePageInfoAttributes( $result, $entityId );
                $actual = $this->replaceHashWithMock( $actual );
diff --git a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php 
b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
index 65d3599..8663060 100644
--- a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
+++ b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
@@ -56,7 +56,7 @@
                if ( $expectedExceptionCode ) {
                        $mock->expects( $this->once() )
                                ->method( 'dieException' )
-                               ->with( $this->isInstanceOf( 'Exception' ), 
$expectedExceptionCode )
+                               ->with( $this->isInstanceOf( Exception::class 
), $expectedExceptionCode )
                                ->will( $this->throwException( new 
UsageException( 'mockUsageException', 'mock' ) ) );
                }
                if ( $expectedErrorCode ) {
diff --git a/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php 
b/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
index 2431ecf..e4ae989 100644
--- a/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
+++ b/repo/tests/phpunit/includes/Api/FormatSnakValueTest.php
@@ -7,6 +7,7 @@
 use DataValues\QuantityValue;
 use DataValues\StringValue;
 use DataValues\TimeValue;
+use UsageException;
 use Wikibase\DataModel\Entity\EntityIdValue;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
@@ -251,7 +252,7 @@
                );
 
                $this->setExpectedException(
-                       'UsageException',
+                       UsageException::class,
                        'The parameters datatype, property can not be used 
together'
                );
                $this->doApiRequest( $params );
diff --git a/repo/tests/phpunit/includes/Api/GetClaimsStatementFilterTest.php 
b/repo/tests/phpunit/includes/Api/GetClaimsStatementFilterTest.php
index deaa1db..e80901e 100644
--- a/repo/tests/phpunit/includes/Api/GetClaimsStatementFilterTest.php
+++ b/repo/tests/phpunit/includes/Api/GetClaimsStatementFilterTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\DataModel\Services\Tests\Statement\Filter;
 
 use PHPUnit_Framework_TestCase;
+use RuntimeException;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\DataModel\Snak\PropertyNoValueSnak;
 use Wikibase\DataModel\Statement\Statement;
@@ -34,7 +35,7 @@
                        $errorReporter->expects( $this->once() )
                                ->method( 'dieException' )
                                ->with(
-                                       $this->isInstanceOf( 'RuntimeException' 
),
+                                       $this->isInstanceOf( 
RuntimeException::class ),
                                        'param-invalid'
                                );
                }
diff --git a/repo/tests/phpunit/includes/Api/MergeItemsTest.php 
b/repo/tests/phpunit/includes/Api/MergeItemsTest.php
index 9af37d1..3b7cea0 100644
--- a/repo/tests/phpunit/includes/Api/MergeItemsTest.php
+++ b/repo/tests/phpunit/includes/Api/MergeItemsTest.php
@@ -239,7 +239,7 @@
        }
 
        private function callApiModule( $params, EntityRedirect 
$expectedRedirect = null ) {
-               $module = $this->apiModuleTestHelper->newApiModule( 
'Wikibase\Repo\Api\MergeItems', 'wbmergeitems', $params );
+               $module = $this->apiModuleTestHelper->newApiModule( 
MergeItems::class, 'wbmergeitems', $params );
                $this->overrideServices( $module, $expectedRedirect );
 
                $module->execute();
diff --git a/repo/tests/phpunit/includes/Api/ParseValueTest.php 
b/repo/tests/phpunit/includes/Api/ParseValueTest.php
index ec64133..93970f6 100644
--- a/repo/tests/phpunit/includes/Api/ParseValueTest.php
+++ b/repo/tests/phpunit/includes/Api/ParseValueTest.php
@@ -9,6 +9,7 @@
 use Language;
 use UsageException;
 use ValueParsers\NullParser;
+use ValueParsers\ParseException;
 use Wikibase\Repo\Api\ApiErrorReporter;
 use Wikibase\Repo\Api\ParseValue;
 use Wikibase\Repo\BuilderBasedDataTypeValidatorFactory;
@@ -225,7 +226,7 @@
                                ),
                                array(
                                        '0/raw' => 'XYZ',
-                                       '0/error' => 
'ValueParsers\ParseException',
+                                       '0/error' => ParseException::class,
                                        '0/error-info' => '/^.+$/',
                                        '0/messages/0/html/*' => '/^.+$/',
                                ),
@@ -237,7 +238,7 @@
                                        'datatype' => 'globe-coordinate',
                                ),
                                array(
-                                       '0/error' => 
'ValueParsers\ParseException',
+                                       '0/error' => ParseException::class,
                                        '1/type' => 'globecoordinate',
                                ),
                        ),
diff --git a/repo/tests/phpunit/includes/Api/SetQualifierTest.php 
b/repo/tests/phpunit/includes/Api/SetQualifierTest.php
index a1b9d5f..7c810a3 100644
--- a/repo/tests/phpunit/includes/Api/SetQualifierTest.php
+++ b/repo/tests/phpunit/includes/Api/SetQualifierTest.php
@@ -10,6 +10,8 @@
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\Property;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
+use Wikibase\DataModel\Snak\PropertyNoValueSnak;
+use Wikibase\DataModel\Snak\PropertySomeValueSnak;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Snak\Snak;
 use Wikibase\DataModel\Statement\Statement;
@@ -109,9 +111,9 @@
 
        public function provideAddRequests() {
                return array(
-                       array( 'Wikibase\DataModel\Snak\PropertyNoValueSnak' ),
-                       array( 'Wikibase\DataModel\Snak\PropertySomeValueSnak' 
),
-                       array( 'Wikibase\DataModel\Snak\PropertyValueSnak', new 
StringValue( 'o_O' ) )
+                       array( PropertyNoValueSnak::class ),
+                       array( PropertySomeValueSnak::class ),
+                       array( PropertyValueSnak::class, new StringValue( 'o_O' 
) )
                );
        }
 
@@ -135,7 +137,7 @@
        }
 
        public function provideChangeRequests() {
-               return array( array( 
'Wikibase\DataModel\Snak\PropertyValueSnak', new StringValue( 'o_O' ) ) );
+               return array( array( PropertyValueSnak::class, new StringValue( 
'o_O' ) ) );
        }
 
        /**
diff --git 
a/repo/tests/phpunit/includes/BuilderBasedDataTypeValidatorFactoryTest.php 
b/repo/tests/phpunit/includes/BuilderBasedDataTypeValidatorFactoryTest.php
index 11543bc..7b97aac 100644
--- a/repo/tests/phpunit/includes/BuilderBasedDataTypeValidatorFactoryTest.php
+++ b/repo/tests/phpunit/includes/BuilderBasedDataTypeValidatorFactoryTest.php
@@ -6,6 +6,8 @@
 use PHPUnit_Framework_TestCase;
 use ValueValidators\NullValidator;
 use Wikibase\Repo\BuilderBasedDataTypeValidatorFactory;
+use Wikimedia\Assert\ParameterElementTypeException;
+use Wikimedia\Assert\PostconditionException;
 
 /**
  * @covers Wikibase\Repo\BuilderBasedDataTypeValidatorFactory
@@ -19,7 +21,7 @@
 class BuilderBasedDataTypeValidatorFactoryTest extends 
PHPUnit_Framework_TestCase {
 
        public function testInvalidConstructorArgument() {
-               $this->setExpectedException( 
'Wikimedia\Assert\ParameterElementTypeException' );
+               $this->setExpectedException( 
ParameterElementTypeException::class );
                new BuilderBasedDataTypeValidatorFactory( array( 'invalid' ) );
        }
 
@@ -33,7 +35,7 @@
                $factory = new BuilderBasedDataTypeValidatorFactory( array( 
'id' => function() {
                        return 'invalid';
                } ) );
-               $this->setExpectedException( 
'Wikimedia\Assert\PostconditionException' );
+               $this->setExpectedException( PostconditionException::class );
                $factory->getValidators( 'id' );
        }
 
@@ -48,7 +50,7 @@
                $factory = new BuilderBasedDataTypeValidatorFactory( array( 
'id' => function() {
                        return array( 'invalid' );
                } ) );
-               $this->setExpectedException( 
'Wikimedia\Assert\PostconditionException' );
+               $this->setExpectedException( PostconditionException::class );
                $factory->getValidators( 'id' );
        }
 
diff --git a/repo/tests/phpunit/includes/ChangeDispatcherTest.php 
b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
index 5d02249..110fb3a 100644
--- a/repo/tests/phpunit/includes/ChangeDispatcherTest.php
+++ b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
@@ -13,6 +13,8 @@
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\PropertyId;
+use Wikibase\EntityChange;
+use Wikibase\ItemChange;
 use Wikibase\Lib\Reporting\ExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Lib\Reporting\NullMessageReporter;
@@ -177,8 +179,9 @@
         * @return Change
         */
        private function newChange( $changeId, EntityId $entityId, $time, Diff 
$siteLinkDiff = null ) {
-               $changeClass = ( $entityId->getEntityType() === 
Item::ENTITY_TYPE )
-                       ? 'Wikibase\ItemChange' : 'Wikibase\EntityChange';
+               $changeClass = $entityId->getEntityType() === Item::ENTITY_TYPE
+                       ? ItemChange::class
+                       : EntityChange::class;
 
                $change = $this->getMockBuilder( $changeClass )
                        ->disableOriginalConstructor()
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
index 00738bf..b4654cf 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpAliasesTest.php
@@ -4,6 +4,7 @@
 
 use InvalidArgumentException;
 use Wikibase\ChangeOp\ChangeOpAliases;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\ItemContent;
 
@@ -149,7 +150,7 @@
 
                $changeOpAliases = new ChangeOpAliases( 'en', array( 'test' ), 
'invalidAction', $validatorFactory );
 
-               $this->setExpectedException( 
'Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
                $changeOpAliases->apply( $entity );
        }
 
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
index 09f0332..81cbe52 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
@@ -7,6 +7,7 @@
 use DataValues\StringValue;
 use InvalidArgumentException;
 use Wikibase\ChangeOp\ChangeOp;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpMainSnak;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
@@ -171,7 +172,7 @@
         * @dataProvider provideInvalidApply
         */
        public function testInvalidApply( EntityDocument $item, ChangeOp 
$changeOp ) {
-               $this->setExpectedException( 
'Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
 
                $changeOp->apply( $item );
        }
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php
index 2f5669f..af5e00f 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php
@@ -5,6 +5,7 @@
 use DataValues\NumberValue;
 use DataValues\StringValue;
 use InvalidArgumentException;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpQualifier;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\Item;
@@ -176,7 +177,7 @@
         * @dataProvider applyInvalidProvider
         */
        public function testApplyInvalid( EntityDocument $entity, $claimGuid, 
Snak $snak, $snakHash = '' ) {
-               $this->setExpectedException( 
'Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
                $changeOpQualifier = new ChangeOpQualifier(
                        $claimGuid,
                        $snak,
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
index 0b4e0de..bafe52a 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
@@ -5,6 +5,7 @@
 use DataValues\NumberValue;
 use DataValues\StringValue;
 use InvalidArgumentException;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpReference;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\Item;
@@ -263,7 +264,7 @@
         * @dataProvider provideApplyInvalid
         */
        public function testApplyInvalid( EntityDocument $entity, $claimGuid, 
Reference $reference, $referenceHash = '', $index = null ) {
-               $this->setExpectedException( 
'Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
 
                $changeOpReference = new ChangeOpReference(
                        $claimGuid,
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
index a83ef2a..6ce4f18 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
@@ -5,6 +5,7 @@
 use DataValues\NumberValue;
 use DataValues\StringValue;
 use InvalidArgumentException;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpStatement;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\Item;
@@ -230,7 +231,7 @@
         * @param Statement $statement
         */
        public function testApplyInvalidThrowsException( Item $item, Statement 
$statement ) {
-               $this->setExpectedException( 
'\Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
 
                $changeOpStatement = $this->newChangeOpStatement( $statement );
                $changeOpStatement->apply( $item );
@@ -311,7 +312,7 @@
         * @dataProvider provideInvalidApply
         */
        public function testInvalidApply( Item $item, ChangeOpStatement 
$changeOp ) {
-               $this->setExpectedException( 
'Wikibase\ChangeOp\ChangeOpException' );
+               $this->setExpectedException( ChangeOpException::class );
 
                $changeOp->apply( $item );
        }
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
index b1b67cf..139a40c 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
@@ -212,7 +212,7 @@
                        ), true )
                );
 
-               $validators = array( new TypeValidator( 'DataValues\DataValue' 
), $topValidator );
+               $validators = array( new TypeValidator( DataValue::class ), 
$topValidator );
 
                $mock = $this->getMock( DataTypeValidatorFactory::class );
                $mock->expects( PHPUnit_Framework_TestCase::any() )
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
index 58b260d..ffc3367 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
@@ -9,6 +9,7 @@
 use TestSites;
 use ValueValidators\Error;
 use ValueValidators\Result;
+use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpFactoryProvider;
 use Wikibase\ChangeOp\ChangeOpsMerge;
 use Wikibase\DataModel\Entity\EntityIdValue;
@@ -453,7 +454,7 @@
                );
 
                $this->setExpectedException(
-                       '\Wikibase\ChangeOp\ChangeOpException',
+                       ChangeOpException::class,
                        'Conflicting sitelinks for enwiki, Failed to normalize'
                );
 
@@ -470,10 +471,7 @@
                        $to
                );
 
-               $this->setExpectedException(
-                       '\Wikibase\ChangeOp\ChangeOpException',
-                       'SiteLink conflict'
-               );
+               $this->setExpectedException( ChangeOpException::class, 
'SiteLink conflict' );
                $changeOps->apply();
        }
 
@@ -506,7 +504,7 @@
                $changeOps = $this->makeChangeOpsMerge( $from, $to );
 
                $this->setExpectedException(
-                       '\Wikibase\ChangeOp\ChangeOpException',
+                       ChangeOpException::class,
                        'The two items cannot be merged because one of them 
links to the other using property P42'
                );
                $changeOps->apply();
@@ -523,7 +521,7 @@
                $changeOps = $this->makeChangeOpsMerge( $from, $to );
 
                $this->setExpectedException(
-                       '\Wikibase\ChangeOp\ChangeOpException',
+                       ChangeOpException::class,
                        'The two items cannot be merged because one of them 
links to the other using property P42'
                );
                $changeOps->apply();
diff --git 
a/repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php 
b/repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php
index 4f05567..b8613d4 100644
--- a/repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php
+++ b/repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php
@@ -10,6 +10,7 @@
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\Entity\Property;
 use Wikibase\Lib\Store\EntityContentDataCodec;
 use Wikibase\Repo\WikibaseRepo;
 
@@ -75,7 +76,7 @@
                $entity = $this->newEntity();
                $holder = $this->newHolder( $entity );
 
-               $actual = $holder->getEntity( 'Wikibase\DataModel\Entity\Item' 
);
+               $actual = $holder->getEntity( Item::class );
                $this->assertEquals( $entity, $actual );
        }
 
@@ -90,9 +91,9 @@
                $item = $this->newEntity();
                $holder = $this->newHolder( $item );
 
-               $holder->getEntity( 'Wikibase\DataModel\Entity\Item' );
+               $holder->getEntity( Item::class );
                $this->setExpectedException( RuntimeException::class );
-               $holder->getEntity( 'Wikibase\DataModel\Entity\Property' );
+               $holder->getEntity( Property::class );
        }
 
        public function 
testGivenMismatchingEntityType_getEntityThrowsException() {
@@ -108,7 +109,7 @@
                $holder = $this->newHolder( $item, 'property' );
 
                $this->setExpectedException( RuntimeException::class );
-               $holder->getEntity( 'Wikibase\DataModel\Entity\Property' );
+               $holder->getEntity( Property::class );
        }
 
        public function testGivenMismatchingIds_getEntityThrowsException() {
diff --git a/repo/tests/phpunit/includes/Content/EntityContentTest.php 
b/repo/tests/phpunit/includes/Content/EntityContentTest.php
index 0a00fe7..050f58e 100644
--- a/repo/tests/phpunit/includes/Content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/Content/EntityContentTest.php
@@ -4,6 +4,7 @@
 
 use Diff\DiffOp\Diff\Diff;
 use Diff\DiffOp\DiffOpChange;
+use Diff\Patcher\PatcherException;
 use ParserOutput;
 use PHPUnit_Framework_Assert;
 use Title;
@@ -353,7 +354,7 @@
         */
        public function testGetPatchedCopy( EntityContent $base, 
EntityContentDiff $patch, EntityContent $expected = null ) {
                if ( $expected === null ) {
-                       $this->setExpectedException( 
'Diff\Patcher\PatcherException' );
+                       $this->setExpectedException( PatcherException::class );
                }
 
                $actual = $base->getPatchedCopy( $patch );
diff --git a/repo/tests/phpunit/includes/Content/ItemHandlerTest.php 
b/repo/tests/phpunit/includes/Content/ItemHandlerTest.php
index 28fbcbf..0e37dd4 100644
--- a/repo/tests/phpunit/includes/Content/ItemHandlerTest.php
+++ b/repo/tests/phpunit/includes/Content/ItemHandlerTest.php
@@ -44,7 +44,7 @@
         * @return string
         */
        public function getClassName() {
-               return 'Wikibase\Repo\Content\ItemHandler';
+               return ItemHandler::class;
        }
 
        /**
diff --git a/repo/tests/phpunit/includes/Content/PropertyHandlerTest.php 
b/repo/tests/phpunit/includes/Content/PropertyHandlerTest.php
index 7bc0810..eff02cf 100644
--- a/repo/tests/phpunit/includes/Content/PropertyHandlerTest.php
+++ b/repo/tests/phpunit/includes/Content/PropertyHandlerTest.php
@@ -38,7 +38,7 @@
         * @return string
         */
        public function getClassName() {
-               return 'Wikibase\Repo\Content\PropertyHandler';
+               return PropertyHandler::class;
        }
 
        /**
diff --git a/repo/tests/phpunit/includes/EditEntityTest.php 
b/repo/tests/phpunit/includes/EditEntityTest.php
index 6a8b8cb..7458d4d 100644
--- a/repo/tests/phpunit/includes/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/EditEntityTest.php
@@ -784,7 +784,7 @@
                $titleLookup = $this->getEntityTitleLookup();
                $item = new Item();
 
-               $isNew = new ReflectionMethod( 'Wikibase\EditEntity', 'isNew' );
+               $isNew = new ReflectionMethod( EditEntity::class, 'isNew' );
                $isNew->setAccessible( true );
 
                $edit = $this->makeEditEntity( $repo, $item, $titleLookup );
diff --git a/repo/tests/phpunit/includes/GenericEventDispatcherTest.php 
b/repo/tests/phpunit/includes/GenericEventDispatcherTest.php
index 59b6f4e..96f0b15 100644
--- a/repo/tests/phpunit/includes/GenericEventDispatcherTest.php
+++ b/repo/tests/phpunit/includes/GenericEventDispatcherTest.php
@@ -36,7 +36,7 @@
                        ->method( 'entityDeleted' )
                        ->with( $this->equalTo( $q12 ) );
 
-               $dispatcher = new GenericEventDispatcher( 
'Wikibase\Lib\Store\EntityStoreWatcher' );
+               $dispatcher = new GenericEventDispatcher( 
EntityStoreWatcher::class );
 
                // check register & dispatch
                $handle = $dispatcher->registerWatcher( $watcher );
diff --git a/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php 
b/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
index 1163199..1c40394 100644
--- a/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
+++ b/repo/tests/phpunit/includes/Hooks/EditFilterHookRunnerTest.php
@@ -54,11 +54,11 @@
                        ->getMock();
                $entityContentFactory->expects( $this->any() )
                        ->method( 'newFromEntity' )
-                       ->with( $this->isInstanceOf( 
'Wikibase\DataModel\Entity\EntityDocument' ) )
+                       ->with( $this->isInstanceOf( EntityDocument::class ) )
                        ->will( $this->returnValue( ItemContent::newEmpty() ) );
                $entityContentFactory->expects( $this->any() )
                        ->method( 'newFromRedirect' )
-                       ->with( $this->isInstanceOf( 
'Wikibase\DataModel\Entity\EntityRedirect' ) )
+                       ->with( $this->isInstanceOf( EntityRedirect::class ) )
                        ->will( $this->returnValue( ItemContent::newEmpty() ) );
 
                return new EditFilterHookRunner(
diff --git 
a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php 
b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
index 1fe24b2..3c1a3b3 100644
--- a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php
@@ -456,7 +456,7 @@
         * @dataProvider permissionProvider
         */
        public function testSetRedirect_noPermission( $permission ) {
-               $this->setExpectedException( 
'Wikibase\Repo\Interactors\ItemMergeException' );
+               $this->setExpectedException( ItemMergeException::class );
 
                $user = User::newFromName( 'UserWithoutPermission-' . 
$permission );
 
diff --git 
a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php 
b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
index 5ba05d8..f99bb0a 100644
--- a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
@@ -231,7 +231,7 @@
         * @dataProvider permissionProvider
         */
        public function testSetRedirect_noPermission( $permission ) {
-               $this->setExpectedException( 
'Wikibase\Repo\Interactors\RedirectCreationException' );
+               $this->setExpectedException( RedirectCreationException::class );
 
                $user = User::newFromName( 'UserWithoutPermission-' . 
$permission );
 
diff --git 
a/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php 
b/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php
index 7d29129..4964c88 100644
--- a/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php
+++ b/repo/tests/phpunit/includes/ParserOutput/GeoDataDataUpdaterTest.php
@@ -8,6 +8,7 @@
 use DataValues\StringValue;
 use GeoData\Coord;
 use GeoData\CoordinatesOutput;
+use GeoData\GeoData;
 use ParserOutput;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\PropertyId;
@@ -33,10 +34,7 @@
 class GeoDataDataUpdaterTest extends \MediaWikiTestCase {
 
        private function willSkipTests() {
-               if ( !class_exists( 'GeoData\GeoData' ) ) {
-                       return true;
-               }
-               return false;
+               return !class_exists( GeoData::class );
        }
 
        protected function setUp() {
diff --git a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php 
b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
index 1dafb7b..0849b7c 100644
--- a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
+++ b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
@@ -4,6 +4,7 @@
 
 use DataTypes\DataType;
 use DataTypes\DataTypeFactory;
+use InvalidArgumentException;
 use PHPUnit_Framework_TestCase;
 use User;
 use Wikibase\DataModel\Entity\Property;
@@ -38,7 +39,7 @@
                        ->with(
                                $expectedProperty,
                                'Changed data type from rustydata to shinydata',
-                               $this->isInstanceOf( 'User' ),
+                               $this->isInstanceOf( User::class ),
                                EDIT_UPDATE, 6789
                        )
                        ->will( $this->returnValue( new EntityRevision( 
$expectedProperty, 6790 ) ) );
@@ -55,7 +56,7 @@
                $propertyDataTypeChanger = $this->getPropertyDataTypeChanger( 
$entityStore );
 
                $this->setExpectedException(
-                       'Wikibase\Lib\Store\StorageException',
+                       StorageException::class,
                        "Could not load property: P43"
                );
                $propertyDataTypeChanger->changeDataType( $propertyId, 
$this->getMock( User::class ), 'shinydata' );
@@ -73,14 +74,14 @@
                        ->with(
                                $expectedProperty,
                                'Changed data type from rustydata to shinydata',
-                               $this->isInstanceOf( 'User' ),
+                               $this->isInstanceOf( User::class ),
                                EDIT_UPDATE, 6789
                        )
                        ->will( $this->throwException( $storageException ) );
 
                $propertyDataTypeChanger = $this->getPropertyDataTypeChanger( 
$entityStore );
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\StorageException' );
+               $this->setExpectedException( StorageException::class );
                $propertyDataTypeChanger->changeDataType( $propertyId, 
$this->getMock( User::class ), 'shinydata' );
        }
 
@@ -92,7 +93,7 @@
                $propertyDataTypeChanger = $this->getPropertyDataTypeChanger( 
$entityStore );
 
                $this->setExpectedException(
-                       'InvalidArgumentException',
+                       InvalidArgumentException::class,
                        "New and old data type must have the same data value 
type."
                );
                $propertyDataTypeChanger->changeDataType( $propertyId, 
$this->getMock( User::class ), 'otherdatatype' );
diff --git a/repo/tests/phpunit/includes/Rdf/RdfVocabularyTest.php 
b/repo/tests/phpunit/includes/Rdf/RdfVocabularyTest.php
index 1ededb1..407ce89 100644
--- a/repo/tests/phpunit/includes/Rdf/RdfVocabularyTest.php
+++ b/repo/tests/phpunit/includes/Rdf/RdfVocabularyTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Repo\Tests\Rdf;
 
 use DataValues\StringValue;
+use OutOfBoundsException;
 use PHPUnit_Framework_TestCase;
 use Wikibase\DataModel\Entity\Property;
 use Wikibase\DataModel\Entity\PropertyId;
@@ -91,7 +92,7 @@
                        $this->assertEquals( $uri, $vocab->getNamespaceURI( $ns 
) );
                }
 
-               $this->setExpectedException( 'OutOfBoundsException' );
+               $this->setExpectedException( OutOfBoundsException::class );
                $vocab->getNamespaceURI( 
'NonExistingNamespaceForGetNamespaceUriTest' );
        }
 
diff --git a/repo/tests/phpunit/includes/SnakConstructionServiceTest.php 
b/repo/tests/phpunit/includes/SnakConstructionServiceTest.php
index 8e72a79..1b4daf5 100644
--- a/repo/tests/phpunit/includes/SnakConstructionServiceTest.php
+++ b/repo/tests/phpunit/includes/SnakConstructionServiceTest.php
@@ -5,8 +5,13 @@
 use DataTypes\DataTypeFactory;
 use DataValues\DataValueFactory;
 use DataValues\Deserializers\DataValueDeserializer;
+use DataValues\StringValue;
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Services\Lookup\InMemoryDataTypeLookup;
+use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException;
+use Wikibase\DataModel\Snak\PropertyNoValueSnak;
+use Wikibase\DataModel\Snak\PropertySomeValueSnak;
+use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\Repo\SnakConstructionService;
 
 /**
@@ -25,7 +30,7 @@
                $dataTypeLookup = new InMemoryDataTypeLookup();
                $dataTypeFactory = new DataTypeFactory( array( 'string' => 
'string' ) );
                $dataValueFactory = new DataValueFactory( new 
DataValueDeserializer( array(
-                       'string' => 'DataValues\StringValue',
+                       'string' => StringValue::class,
                ) ) );
 
                $dataTypeLookup->setDataTypeForProperty( new PropertyId( 'p1' 
), 'string' );
@@ -62,34 +67,34 @@
                return array(
                        'novalue' => array(
                                1, 'novalue', null,
-                               'Wikibase\DataModel\Snak\PropertyNoValueSnak',
+                               PropertyNoValueSnak::class,
                        ),
                        'somevalue' => array(
                                1, 'somevalue', null,
-                               'Wikibase\DataModel\Snak\PropertySomeValueSnak',
+                               PropertySomeValueSnak::class,
                        ),
                        'value' => array(
                                1, 'value', '"hello"',
-                               'Wikibase\DataModel\Snak\PropertyValueSnak',
+                               PropertyValueSnak::class,
                        ),
                        'novalue/badprop' => array(
                                66, 'novalue', null,
-                               'Wikibase\DataModel\Snak\PropertyNoValueSnak',
-                               
'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException'
+                               PropertyNoValueSnak::class,
+                               PropertyDataTypeLookupException::class
                        ),
                        'somevalue/badprop' => array(
                                66, 'somevalue', null,
-                               'Wikibase\DataModel\Snak\PropertySomeValueSnak',
-                               
'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException'
+                               PropertySomeValueSnak::class,
+                               PropertyDataTypeLookupException::class
                        ),
                        'value/badprop' => array(
                                66, 'value', '"hello"',
-                               'Wikibase\DataModel\Snak\PropertyValueSnak',
-                               
'Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookupException'
+                               PropertyValueSnak::class,
+                               PropertyDataTypeLookupException::class
                        ),
                        'value/badvalue' => array(
                                1, 'value', array( 'foo' ),
-                               'Wikibase\DataModel\Snak\PropertyValueSnak',
+                               PropertyValueSnak::class,
                                'InvalidArgumentException'
                        ),
                );
diff --git a/repo/tests/phpunit/includes/StatementRankSerializerTest.php 
b/repo/tests/phpunit/includes/StatementRankSerializerTest.php
index 9dce324..980f7da 100644
--- a/repo/tests/phpunit/includes/StatementRankSerializerTest.php
+++ b/repo/tests/phpunit/includes/StatementRankSerializerTest.php
@@ -3,7 +3,9 @@
 namespace Wikibase\Test;
 
 use DataValues\Serializers\DataValueSerializer;
+use Deserializers\Exceptions\DeserializationException;
 use PHPUnit_Framework_TestCase;
+use Serializers\Exceptions\SerializationException;
 use Wikibase\DataModel\SerializerFactory;
 use Wikibase\DataModel\Snak\PropertyNoValueSnak;
 use Wikibase\DataModel\Statement\Statement;
@@ -76,13 +78,13 @@
 
        public function testGivenInvalidRank_serializationFails() {
                $serializer = new StatementRankSerializer();
-               $this->setExpectedException( 
'Serializers\Exceptions\SerializationException' );
+               $this->setExpectedException( SerializationException::class );
                $serializer->serialize( -1 );
        }
 
        public function testGivenInvalidSerialization_deserializeFails() {
                $serializer = new StatementRankSerializer();
-               $this->setExpectedException( 
'Deserializers\Exceptions\DeserializationException' );
+               $this->setExpectedException( DeserializationException::class );
                $serializer->deserialize( 'invalid' );
        }
 
diff --git 
a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php 
b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
index 2089452..db48aab 100644
--- a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
@@ -6,6 +6,7 @@
 use LoadBalancer;
 use MediaWikiTestCase;
 use Title;
+use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException;
 use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Store\EntityIdLookup;
 use WikiPage;
@@ -93,7 +94,7 @@
        }
 
        public function testGetRedirectForEntityId_entityDoesNotExist() {
-               $this->setExpectedException( 
'Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException' );
+               $this->setExpectedException( 
EntityRedirectLookupException::class );
                
$this->getWikiPageEntityRedirectLookup()->getRedirectForEntityId( new ItemId( 
'Q48758903' ) );
        }
 
diff --git a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php 
b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
index f264005..32f242e 100644
--- a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
@@ -165,14 +165,14 @@
                                'entity' => $firstItem,
                                'flags' => EDIT_NEW,
                                'baseRevid' => false,
-                               'error' => 'Wikibase\Lib\Store\StorageException'
+                               'error' => StorageException::class
                        ),
 
                        'not exists' => array(
                                'entity' => $secondItem,
                                'flags' => EDIT_UPDATE,
                                'baseRevid' => false,
-                               'error' => 'Wikibase\Lib\Store\StorageException'
+                               'error' => StorageException::class
                        ),
                );
        }
@@ -284,7 +284,7 @@
                list( $store, ) = $this->createStoreAndLookup();
                $user = $GLOBALS['wgUser'];
 
-               $this->setExpectedException( 
'Wikibase\Lib\Store\StorageException' );
+               $this->setExpectedException( StorageException::class );
                $store->saveRedirect( $redirect, 'redirect one', $user, 
EDIT_UPDATE );
        }
 
diff --git 
a/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php 
b/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php
index 6f3825e..5643475 100644
--- a/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php
+++ b/repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php
@@ -10,6 +10,7 @@
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\EntityContentDataCodec;
 use Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup;
+use Wikibase\Lib\Store\StorageException;
 use Wikibase\Lib\Store\WikiPageEntityRevisionLookup;
 use MWContentSerializationException;
 use Wikibase\Repo\WikibaseRepo;
@@ -109,7 +110,7 @@
                );
 
                $this->setExpectedException(
-                       'Wikibase\Lib\Store\StorageException',
+                       StorageException::class,
                        'Failed to unserialize the content object.'
                );
                $lookup->getEntityRevision( new ItemId( 'Q42' ) );
diff --git a/repo/tests/phpunit/includes/Validators/TypeValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/TypeValidatorTest.php
index e2f0a2e..2bb0cca 100644
--- a/repo/tests/phpunit/includes/Validators/TypeValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/TypeValidatorTest.php
@@ -25,9 +25,9 @@
                        array( 'integer', 1.1, false, "not an integer" ),
                        array( 'object', new StringValue( "foo" ), true, 
"object" ),
                        array( 'object', "foo", false, "not an object" ),
-                       array( 'DataValues\StringValue', new StringValue( "foo" 
), true, "StringValue" ),
-                       array( 'DataValues\StringValue', new NumberValue( 7 ), 
false, "not a StringValue" ),
-                       array( 'DataValues\StringValue', 33, false, "definitly 
not a StringValue" ),
+                       array( StringValue::class, new StringValue( "foo" ), 
true, "StringValue" ),
+                       array( StringValue::class, new NumberValue( 7 ), false, 
"not a StringValue" ),
+                       array( StringValue::class, 33, false, "definitly not a 
StringValue" ),
                );
        }
 
diff --git a/repo/tests/phpunit/includes/Validators/UrlSchemeValidatorsTest.php 
b/repo/tests/phpunit/includes/Validators/UrlSchemeValidatorsTest.php
index 6993874..6320c96 100644
--- a/repo/tests/phpunit/includes/Validators/UrlSchemeValidatorsTest.php
+++ b/repo/tests/phpunit/includes/Validators/UrlSchemeValidatorsTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Test\Repo\Validators;
 
 use ValueValidators\Result;
+use ValueValidators\ValueValidator;
 use Wikibase\Repo\Validators\UrlSchemeValidators;
 use Wikibase\Repo\Validators\ValidatorErrorLocalizer;
 
@@ -133,7 +134,7 @@
                $validators = $factory->getValidators( $schemes );
 
                $this->assertEquals( array( 'http', 'https', 'ftp' ), 
array_keys( $validators ) );
-               $this->assertContainsOnlyInstancesOf( 
'ValueValidators\ValueValidator', $validators );
+               $this->assertContainsOnlyInstancesOf( ValueValidator::class, 
$validators );
        }
 
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/277211
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I487b8180fee9c01385da7ce05e3f86628213bd88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to