diff --git a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
index 000c337..fbe2abb 100644
--- a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -3,6 +3,7 @@
 namespace Drupal\Component\Annotation\Plugin\Discovery;
 
 use Drupal\Component\Annotation\AnnotationInterface;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Component\Annotation\Reflection\MockFileFinder;
@@ -69,7 +70,7 @@ class AnnotatedClassDiscovery implements DiscoveryInterface {
    * @param string[] $annotation_namespaces
    *   (optional) Additional namespaces to be scanned for annotation classes.
    */
-  public function __construct($plugin_namespaces = [], $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) {
+  public function __construct($plugin_namespaces = [], $plugin_definition_annotation_name = Plugin::class, array $annotation_namespaces = []) {
     $this->pluginNamespaces = $plugin_namespaces;
     $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
     $this->annotationNamespaces = $annotation_namespaces;
diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index 0158eac..59fb0f9 100644
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -343,10 +343,10 @@ public function diff($datetime2, $absolute = FALSE) {
    * Passes through all unknown static calls onto the DateTime object.
    */
   public static function __callStatic($method, $args) {
-    if (!method_exists('\DateTime', $method)) {
+    if (!method_exists(\DateTime::class, $method)) {
       throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_called_class(), $method));
     }
-    return call_user_func_array(['\DateTime', $method], $args);
+    return call_user_func_array([\DateTime::class, $method], $args);
   }
 
   /**
diff --git a/core/lib/Drupal/Component/FileCache/FileCacheFactory.php b/core/lib/Drupal/Component/FileCache/FileCacheFactory.php
index 15b2026..5916b24 100644
--- a/core/lib/Drupal/Component/FileCache/FileCacheFactory.php
+++ b/core/lib/Drupal/Component/FileCache/FileCacheFactory.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Component\FileCache;
 
+use \Drupal\Component\FileCache\FileCache;
+
 /**
  * Creates a FileCache object.
  */
@@ -61,7 +63,7 @@ public static function get($collection, $default_configuration = []) {
 
     // Ensure that all properties are set.
     $fallback_configuration = [
-      'class' => '\Drupal\Component\FileCache\FileCache',
+      'class' => FileCache::class,
       'collection' => $collection,
       'cache_backend_class' => NULL,
       'cache_backend_configuration' => [],
diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
index 6b47af0..c70fbd4 100644
--- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Component\Plugin\Discovery;
 
+use \Drupal\Component\Plugin\Derivative\DeriverInterface;
 use Drupal\Component\Plugin\Definition\DerivablePluginDefinitionInterface;
 use Drupal\Component\Plugin\Exception\InvalidDeriverException;
 
@@ -217,7 +218,7 @@ protected function getDeriverClass($base_definition) {
       if (!class_exists($class)) {
         throw new InvalidDeriverException(sprintf('Plugin (%s) deriver "%s" does not exist.', $id, $class));
       }
-      if (!is_subclass_of($class, '\Drupal\Component\Plugin\Derivative\DeriverInterface')) {
+      if (!is_subclass_of($class, DeriverInterface::class)) {
         throw new InvalidDeriverException(sprintf('Plugin (%s) deriver "%s" must implement \Drupal\Component\Plugin\Derivative\DeriverInterface.', $id, $class));
       }
     }
diff --git a/core/lib/Drupal/Core/Action/ActionManager.php b/core/lib/Drupal/Core/Action/ActionManager.php
index fda253b..1f6ca4e 100644
--- a/core/lib/Drupal/Core/Action/ActionManager.php
+++ b/core/lib/Drupal/Core/Action/ActionManager.php
@@ -3,6 +3,8 @@
 namespace Drupal\Core\Action;
 
 use Drupal\Component\Plugin\CategorizingPluginManagerInterface;
+use Drupal\Core\Action\ActionInterface;
+use Drupal\Core\Annotation\Action;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\CategorizingPluginManagerTrait;
@@ -32,7 +34,7 @@ class ActionManager extends DefaultPluginManager implements CategorizingPluginMa
    *   The module handler to invoke the alter hook with.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/Action', $namespaces, $module_handler, 'Drupal\Core\Action\ActionInterface', 'Drupal\Core\Annotation\Action');
+    parent::__construct('Plugin/Action', $namespaces, $module_handler, ActionInterface::class, Action::class);
     $this->alterInfo('action_info');
     $this->setCacheBackend($cache_backend, 'action_info');
   }
diff --git a/core/lib/Drupal/Core/Annotation/ContextDefinition.php b/core/lib/Drupal/Core/Annotation/ContextDefinition.php
index 0439752..d90b832 100644
--- a/core/lib/Drupal/Core/Annotation/ContextDefinition.php
+++ b/core/lib/Drupal/Core/Annotation/ContextDefinition.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Annotation;
 
 use Drupal\Component\Annotation\Plugin;
+use Drupal\Core\Plugin\Context\ContextDefinitionInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 
 /**
@@ -113,10 +114,10 @@ public function __construct(array $values) {
         $values[$key] = NULL;
       }
     }
-    if (isset($values['class']) && !in_array('Drupal\Core\Plugin\Context\ContextDefinitionInterface', class_implements($values['class']))) {
+    if (isset($values['class']) && !in_array(ContextDefinitionInterface::class, class_implements($values['class']))) {
       throw new \Exception('ContextDefinition class must implement \Drupal\Core\Plugin\Context\ContextDefinitionInterface.');
     }
-    $class = isset($values['class']) ? $values['class'] : 'Drupal\Core\Plugin\Context\ContextDefinition';
+    $class = isset($values['class']) ? $values['class'] : \Drupal\Core\Plugin\Context\ContextDefinition::class;
     $this->definition = new $class($values['value'], $values['label'], $values['required'], $values['multiple'], $values['description'], $values['default_value']);
   }
 
diff --git a/core/lib/Drupal/Core/Archiver/ArchiverManager.php b/core/lib/Drupal/Core/Archiver/ArchiverManager.php
index 7cd11f9..d8b2d7d 100644
--- a/core/lib/Drupal/Core/Archiver/ArchiverManager.php
+++ b/core/lib/Drupal/Core/Archiver/ArchiverManager.php
@@ -3,6 +3,8 @@
 namespace Drupal\Core\Archiver;
 
 use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Core\Archiver\Annotation\Archiver;
+use Drupal\Core\Archiver\ArchiverInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
@@ -28,7 +30,7 @@ class ArchiverManager extends DefaultPluginManager {
    *   The module handler to invoke the alter hook with.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/Archiver', $namespaces, $module_handler, 'Drupal\Core\Archiver\ArchiverInterface', 'Drupal\Core\Archiver\Annotation\Archiver');
+    parent::__construct('Plugin/Archiver', $namespaces, $module_handler, ArchiverInterface::class, Archiver::class);
     $this->alterInfo('archiver_info');
     $this->setCacheBackend($cache_backend, 'archiver_info_plugins');
   }
@@ -38,7 +40,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
    */
   public function createInstance($plugin_id, array $configuration = []) {
     $plugin_definition = $this->getDefinition($plugin_id);
-    $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition, 'Drupal\Core\Archiver\ArchiverInterface');
+    $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition, ArchiverInterface::class);
     return new $plugin_class($configuration['filepath']);
   }
 
diff --git a/core/lib/Drupal/Core/Block/BlockManager.php b/core/lib/Drupal/Core/Block/BlockManager.php
index 30b52b6..b19e6fb 100644
--- a/core/lib/Drupal/Core/Block/BlockManager.php
+++ b/core/lib/Drupal/Core/Block/BlockManager.php
@@ -3,6 +3,8 @@
 namespace Drupal\Core\Block;
 
 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
+use Drupal\Core\Block\Annotation\Block;
+use Drupal\Core\Block\BlockPluginInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\CategorizingPluginManagerTrait;
@@ -35,7 +37,7 @@ class BlockManager extends DefaultPluginManager implements BlockManagerInterface
    *   The module handler to invoke the alter hook with.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/Block', $namespaces, $module_handler, 'Drupal\Core\Block\BlockPluginInterface', 'Drupal\Core\Block\Annotation\Block');
+    parent::__construct('Plugin/Block', $namespaces, $module_handler, BlockPluginInterface::class, Block::class);
 
     $this->alterInfo('block');
     $this->setCacheBackend($cache_backend, 'block_plugins');
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
index f83b867..af7a6cf 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Core\Cache\Apcu4Backend;
+use Drupal\Core\Cache\ApcuBackend;
 use Drupal\Core\Site\Settings;
 
 class ApcuBackendFactory implements CacheFactoryInterface {
@@ -41,10 +43,10 @@ public function __construct($root, $site_path, CacheTagsChecksumInterface $check
     $this->sitePrefix = Settings::getApcuPrefix('apcu_backend', $root, $site_path);
     $this->checksumProvider = $checksum_provider;
     if (version_compare(phpversion('apcu'), '5.0.0', '>=')) {
-      $this->backendClass = 'Drupal\Core\Cache\ApcuBackend';
+      $this->backendClass = ApcuBackend::class;
     }
     else {
-      $this->backendClass = 'Drupal\Core\Cache\Apcu4Backend';
+      $this->backendClass = Apcu4Backend::class;
     }
   }
 
diff --git a/core/lib/Drupal/Core/Condition/ConditionManager.php b/core/lib/Drupal/Core/Condition/ConditionManager.php
index 2c6b61b..6ad0af4 100644
--- a/core/lib/Drupal/Core/Condition/ConditionManager.php
+++ b/core/lib/Drupal/Core/Condition/ConditionManager.php
@@ -4,6 +4,8 @@
 
 use Drupal\Component\Plugin\CategorizingPluginManagerInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Condition\Annotation\Condition;
+use Drupal\Core\Condition\ConditionInterface;
 use Drupal\Core\Executable\ExecutableManagerInterface;
 use Drupal\Core\Executable\ExecutableInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -40,7 +42,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
     $this->alterInfo('condition_info');
     $this->setCacheBackend($cache_backend, 'condition_plugins');
 
-    parent::__construct('Plugin/Condition', $namespaces, $module_handler, 'Drupal\Core\Condition\ConditionInterface', 'Drupal\Core\Condition\Annotation\Condition');
+    parent::__construct('Plugin/Condition', $namespaces, $module_handler, ConditionInterface::class, Condition::class);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
index 11c9ff1..78cd9e5 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Config\Entity;
 
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\Core\Config\Entity\Exception\ConfigEntityStorageClassException;
 use Drupal\Core\Entity\EntityType;
 use Drupal\Core\Config\ConfigPrefixLengthException;
@@ -65,7 +66,7 @@ public function __construct($definition) {
     $this->entity_keys['uuid'] = 'uuid';
     $this->entity_keys['langcode'] = 'langcode';
     $this->handlers += [
-      'storage' => 'Drupal\Core\Config\Entity\ConfigEntityStorage',
+      'storage' => ConfigEntityStorage::class,
     ];
     $this->lookup_keys[] = 'uuid';
   }
@@ -134,7 +135,7 @@ public function getConfigDependencyKey() {
    * @see \Drupal\Core\Config\Entity\ConfigEntityStorage
    */
   protected function checkStorageClass($class) {
-    if (!is_a($class, 'Drupal\Core\Config\Entity\ConfigEntityStorage', TRUE)) {
+    if (!is_a($class, ConfigEntityStorage::class, TRUE)) {
       throw new ConfigEntityStorageClassException("$class is not \\Drupal\\Core\\Config\\Entity\\ConfigEntityStorage or it does not extend it");
     }
   }
diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php
index c6ddfb5..44a76f5 100644
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Config;
 
+use \Drupal\Core\TypedData\DataDefinition;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\Schema\ConfigSchemaAlterException;
@@ -186,7 +187,7 @@ protected function getDefinitionWithReplacements($base_plugin_id, array $replace
     }
     // Add type and default definition class.
     $definition += [
-      'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
+      'definition_class' => DataDefinition::class,
       'type' => $type,
       'unwrap_for_canonical_representation' => TRUE,
     ];
diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php
index 8a22bc5..bc88fd3 100644
--- a/core/lib/Drupal/Core/CoreServiceProvider.php
+++ b/core/lib/Drupal/Core/CoreServiceProvider.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core;
 
+use Drupal\Component\Uuid\Com;
+use Drupal\Component\Uuid\Pecl;
 use Drupal\Core\Cache\Context\CacheContextsPass;
 use Drupal\Core\Cache\ListCacheBinsPass;
 use Drupal\Core\DependencyInjection\Compiler\AuthenticationProviderPass;
@@ -28,6 +30,8 @@
 use Drupal\Core\Plugin\PluginManagerPass;
 use Drupal\Core\Render\MainContent\MainContentRenderersPass;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\StreamWrapper\PrivateStream;
+use Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware;
 use Symfony\Component\DependencyInjection\Compiler\PassConfig;
 
 /**
@@ -52,7 +56,7 @@ public function register(ContainerBuilder $container) {
 
     // Only register the private file stream wrapper if a file path has been set.
     if (Settings::get('file_private_path')) {
-      $container->register('stream_wrapper.private', 'Drupal\Core\StreamWrapper\PrivateStream')
+      $container->register('stream_wrapper.private', PrivateStream::class)
         ->addTag('stream_wrapper', ['scheme' => 'private']);
     }
 
@@ -114,11 +118,11 @@ public function alter(ContainerBuilder $container) {
     // implementation. The OSSP implementation is not compatible with the
     // PECL functions.
     if (function_exists('uuid_create') && !function_exists('uuid_make')) {
-      $uuid_service->setClass('Drupal\Component\Uuid\Pecl');
+      $uuid_service->setClass(Pecl::class);
     }
     // Try to use the COM implementation for Windows users.
     elseif (function_exists('com_create_guid')) {
-      $uuid_service->setClass('Drupal\Component\Uuid\Com');
+      $uuid_service->setClass(Com::class);
     }
   }
 
@@ -135,7 +139,7 @@ protected function registerTest(ContainerBuilder $container) {
     }
     // Add the HTTP request middleware to Guzzle.
     $container
-      ->register('test.http_client.middleware', 'Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware')
+      ->register('test.http_client.middleware', TestHttpClientMiddleware::class)
       ->addTag('http_client_middleware');
   }
 
diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index 803689b..f910780 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Database;
 
+use Drupal\Core\Database\Statement;
+
 /**
  * Base Database API class.
  *
@@ -64,7 +66,7 @@
    *
    * @var string
    */
-  protected $statementClass = 'Drupal\Core\Database\Statement';
+  protected $statementClass = Statement::class;
 
   /**
    * Whether this database connection supports transactions.
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
index a14a83f..c4273af 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Database\Driver\sqlite;
 
+use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\DatabaseNotFoundException;
 use Drupal\Core\Database\Connection as DatabaseConnection;
@@ -146,7 +147,7 @@ public static function open(array &$connection_options = []) {
     $pdo->sqliteCreateFunction('glob', [__CLASS__, 'sqlFunctionLikeBinary']);
 
     // Create a user-space case-insensitive collation with UTF-8 support.
-    $pdo->sqliteCreateCollation('NOCASE_UTF8', ['Drupal\Component\Utility\Unicode', 'strcasecmp']);
+    $pdo->sqliteCreateCollation('NOCASE_UTF8', [Unicode::class, 'strcasecmp']);
 
     // Set SQLite init_commands if not already defined. Enable the Write-Ahead
     // Logging (WAL) for SQLite. See https://www.drupal.org/node/2348137 and
diff --git a/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php b/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php
index 750e697..a7c77ea 100644
--- a/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php
+++ b/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\DependencyInjection;
 
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
 
@@ -24,7 +25,7 @@ public function getInstanceFromDefinition($definition) {
         throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $definition));
       }
 
-      if (is_subclass_of($definition, 'Drupal\Core\DependencyInjection\ContainerInjectionInterface')) {
+      if (is_subclass_of($definition, ContainerInjectionInterface::class)) {
         $instance = $definition::create($this->container);
       }
       else {
diff --git a/core/lib/Drupal/Core/Display/VariantManager.php b/core/lib/Drupal/Core/Display/VariantManager.php
index 5a6bede..debd428 100644
--- a/core/lib/Drupal/Core/Display/VariantManager.php
+++ b/core/lib/Drupal/Core/Display/VariantManager.php
@@ -3,6 +3,8 @@
 namespace Drupal\Core\Display;
 
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Display\Annotation\DisplayVariant;
+use Drupal\Core\Display\VariantInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 
@@ -28,7 +30,7 @@ class VariantManager extends DefaultPluginManager {
    *   The module handler to invoke the alter hook with.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/DisplayVariant', $namespaces, $module_handler, 'Drupal\Core\Display\VariantInterface', 'Drupal\Core\Display\Annotation\DisplayVariant');
+    parent::__construct('Plugin/DisplayVariant', $namespaces, $module_handler, VariantInterface::class, DisplayVariant::class);
 
     $this->setCacheBackend($cache_backend, 'variant_plugins');
     $this->alterInfo('display_variant_plugin');
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 02c97f5..d5b09f3 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -2,13 +2,21 @@
 
 namespace Drupal\Core;
 
+use \Drupal\Component\DependencyInjection\PhpArrayContainer;
+use \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper;
+use \Drupal\Component\FileCache\ApcuFileCacheBackend;
+use \Drupal\Core\DependencyInjection\Container;
 use Composer\Autoload\ClassLoader;
 use Drupal\Component\Assertion\Handle;
 use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\CoreServiceProvider;
+use Drupal\Core\Cache\DatabaseBackend;
+use Drupal\Core\Cache\DatabaseCacheTagsChecksum;
 use Drupal\Core\Config\BootstrapConfigStorageFactory;
 use Drupal\Core\Config\NullStorage;
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceModifierInterface;
@@ -60,7 +68,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
    *
    * @var string
    */
-  protected $phpArrayDumperClass = '\Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper';
+  protected $phpArrayDumperClass = OptimizedPhpArrayDumper::class;
 
   /**
    * Holds the default bootstrap container definition.
@@ -71,16 +79,16 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
     'parameters' => [],
     'services' => [
       'database' => [
-        'class' => 'Drupal\Core\Database\Connection',
+        'class' => Connection::class,
         'factory' => 'Drupal\Core\Database\Database::getConnection',
         'arguments' => ['default'],
       ],
       'cache.container' => [
-        'class' => 'Drupal\Core\Cache\DatabaseBackend',
+        'class' => DatabaseBackend::class,
         'arguments' => ['@database', '@cache_tags_provider.container', 'container'],
       ],
       'cache_tags_provider.container' => [
-        'class' => 'Drupal\Core\Cache\DatabaseCacheTagsChecksum',
+        'class' => DatabaseCacheTagsChecksum::class,
         'arguments' => ['@database'],
       ],
     ],
@@ -91,7 +99,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
    *
    * @var string
    */
-  protected $bootstrapContainerClass = '\Drupal\Component\DependencyInjection\PhpArrayContainer';
+  protected $bootstrapContainerClass = PhpArrayContainer::class;
 
   /**
    * Holds the bootstrap container.
@@ -453,7 +461,7 @@ public function boot() {
       // @todo Use extension_loaded('apcu') for non-testbot
       //  https://www.drupal.org/node/2447753.
       if (function_exists('apcu_fetch')) {
-        $configuration['default']['cache_backend_class'] = '\Drupal\Component\FileCache\ApcuFileCacheBackend';
+        $configuration['default']['cache_backend_class'] = ApcuFileCacheBackend::class;
       }
     }
     FileCacheFactory::setConfiguration($configuration);
@@ -578,7 +586,7 @@ public function discoverServiceProviders() {
       'site' => [],
     ];
     $this->serviceYamls['app']['core'] = 'core/core.services.yml';
-    $this->serviceProviderClasses['app']['core'] = 'Drupal\Core\CoreServiceProvider';
+    $this->serviceProviderClasses['app']['core'] = CoreServiceProvider::class;
 
     // Retrieve enabled modules and register their namespaces.
     if (!isset($this->moduleList)) {
@@ -901,7 +909,7 @@ protected function initializeContainer() {
 
     // Only create a new class if we have a container definition.
     if (isset($container_definition)) {
-      $class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container');
+      $class = Settings::get('container_base_class', Container::class);
       $container = new $class($container_definition);
     }
 
diff --git a/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php b/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
index 4e17852..4fe5f9c 100644
--- a/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
+++ b/core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
@@ -20,7 +20,7 @@ class ConfigEntityType extends EntityType {
   /**
    * {@inheritdoc}
    */
-  public $entity_type_class = 'Drupal\Core\Config\Entity\ConfigEntityType';
+  public $entity_type_class = \Drupal\Core\Config\Entity\ConfigEntityType::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php b/core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
index 0817c93..9ce9ece 100644
--- a/core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
+++ b/core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
@@ -21,7 +21,7 @@ class ContentEntityType extends EntityType {
   /**
    * {@inheritdoc}
    */
-  public $entity_type_class = 'Drupal\Core\Entity\ContentEntityType';
+  public $entity_type_class = \Drupal\Core\Entity\ContentEntityType::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Entity/Annotation/EntityType.php b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
index 99335ae..761a604 100644
--- a/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
+++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php
@@ -29,7 +29,7 @@ class EntityType extends Plugin {
    *
    * @var string
    */
-  public $entity_type_class = 'Drupal\Core\Entity\EntityType';
+  public $entity_type_class = \Drupal\Core\Entity\EntityType::class;
 
   /**
    * The group machine name.
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityType.php b/core/lib/Drupal/Core/Entity/ContentEntityType.php
index 0e26c3b..a84eace 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityType.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityType.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Core\Entity;
 
+use Drupal\Core\Entity\EntityViewBuilder;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
+
 /**
  * Provides an implementation of a content entity type and its metadata.
  */
@@ -20,8 +23,8 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface
   public function __construct($definition) {
     parent::__construct($definition);
     $this->handlers += [
-      'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
-      'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
+      'storage' => SqlContentEntityStorage::class,
+      'view_builder' => EntityViewBuilder::class,
     ];
   }
 
diff --git a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php
index 53b43fd..a0e8693 100644
--- a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php
@@ -3,8 +3,11 @@
 namespace Drupal\Core\Entity\EntityReferenceSelection;
 
 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Entity\Annotation\EntityReferenceSelection;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
@@ -25,7 +28,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
     $this->alterInfo('entity_reference_selection');
     $this->setCacheBackend($cache_backend, 'entity_reference_selection_plugins');
 
-    parent::__construct('Plugin/EntityReferenceSelection', $namespaces, $module_handler, 'Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface', 'Drupal\Core\Entity\Annotation\EntityReferenceSelection');
+    parent::__construct('Plugin/EntityReferenceSelection', $namespaces, $module_handler, SelectionInterface::class, EntityReferenceSelection::class);
   }
 
   /**
@@ -62,7 +65,7 @@ public function getPluginId($target_type, $base_plugin_id) {
     $selection_handler_groups = $this->getSelectionGroups($target_type);
 
     // Sort the selection plugins by weight and select the best match.
-    uasort($selection_handler_groups[$base_plugin_id], ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+    uasort($selection_handler_groups[$base_plugin_id], [SortArray::class, 'sortByWeightElement']);
     end($selection_handler_groups[$base_plugin_id]);
     $plugin_id = key($selection_handler_groups[$base_plugin_id]);
 
diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php
index b39fb3f..d324b08 100644
--- a/core/lib/Drupal/Core/Entity/EntityType.php
+++ b/core/lib/Drupal/Core/Entity/EntityType.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Plugin\Definition\PluginDefinition;
 use Drupal\Component\Utility\Unicode;
+use Drupal\Core\Entity\EntityAccessControlHandler;
 use Drupal\Core\Entity\Exception\EntityTypeIdLengthException;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
@@ -304,7 +305,7 @@ public function __construct($definition) {
       'default_langcode' => 'default_langcode',
     ];
     $this->handlers += [
-      'access' => 'Drupal\Core\Entity\EntityAccessControlHandler',
+      'access' => EntityAccessControlHandler::class,
     ];
     if (isset($this->handlers['storage'])) {
       $this->checkStorageClass($this->handlers['storage']);
diff --git a/core/lib/Drupal/Core/Entity/EntityTypeManager.php b/core/lib/Drupal/Core/Entity/EntityTypeManager.php
index abe96a5..8423b53 100644
--- a/core/lib/Drupal/Core/Entity/EntityTypeManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityTypeManager.php
@@ -6,6 +6,9 @@
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\DependencyInjection\ClassResolverInterface;
+use Drupal\Core\Entity\EntityHandlerInterface;
+use Drupal\Core\Entity\Annotation\EntityType;
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\Exception\InvalidLinkTemplateException;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
@@ -74,12 +77,12 @@ class EntityTypeManager extends DefaultPluginManager implements EntityTypeManage
    *   The class resolver.
    */
   public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver) {
-    parent::__construct('Entity', $namespaces, $module_handler, 'Drupal\Core\Entity\EntityInterface');
+    parent::__construct('Entity', $namespaces, $module_handler, EntityInterface::class);
 
     $this->setCacheBackend($cache, 'entity_type', ['entity_types']);
     $this->alterInfo('entity_type');
 
-    $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\Core\Entity\Annotation\EntityType');
+    $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, EntityType::class);
     $this->stringTranslation = $string_translation;
     $this->classResolver = $class_resolver;
   }
@@ -245,7 +248,7 @@ public function getHandler($entity_type, $handler_type) {
    * {@inheritdoc}
    */
   public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
-    if (is_subclass_of($class, 'Drupal\Core\Entity\EntityHandlerInterface')) {
+    if (is_subclass_of($class, EntityHandlerInterface::class)) {
       $handler = $class::createInstance($this->container, $definition);
     }
     else {
diff --git a/core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php b/core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php
index d8d21fd..954b839 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Plugin\Derivative\DeriverBase;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\Plugin\EntityReferenceSelection\PhpSelection;
 use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -63,7 +64,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
       // of whether a limit has been passed.
       // @see \Drupal\Core\Entity\Plugin\EntityReferenceSelection\PhpSelection
       if (!$entity_type->hasKey('label')) {
-        $this->derivatives[$entity_type_id]['class'] = 'Drupal\Core\Entity\Plugin\EntityReferenceSelection\PhpSelection';
+        $this->derivatives[$entity_type_id]['class'] = PhpSelection::class;
       }
     }
 
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
index 1172406..d6a8cf0 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
@@ -16,6 +16,7 @@
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Core\Entity\Schema\DynamicallyFieldableEntityStorageSchemaInterface;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Language\LanguageInterface;
@@ -248,7 +249,7 @@ public function getRevisionDataTable() {
    */
   protected function getStorageSchema() {
     if (!isset($this->storageSchema)) {
-      $class = $this->entityType->getHandlerClass('storage_schema') ?: 'Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema';
+      $class = $this->entityType->getHandlerClass('storage_schema') ?: SqlContentEntityStorageSchema::class;
       $this->storageSchema = new $class($this->entityManager, $this->entityType, $this, $this->database);
     }
     return $this->storageSchema;
diff --git a/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php b/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
index be6405a..12fb71c 100644
--- a/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
+++ b/core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Entity\TypedData;
 
+use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\TypedData\ComplexDataDefinitionBase;
 
 /**
@@ -54,7 +55,7 @@ public function getPropertyDefinitions() {
       if ($entity_type_id = $this->getEntityTypeId()) {
         // Return an empty array for entities that are not content entities.
         $entity_type_class = \Drupal::entityManager()->getDefinition($entity_type_id)->getClass();
-        if (!in_array('Drupal\Core\Entity\FieldableEntityInterface', class_implements($entity_type_class))) {
+        if (!in_array(FieldableEntityInterface::class, class_implements($entity_type_class))) {
           $this->propertyDefinitions = [];
         }
         else {
diff --git a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
index 905cdb4..55943ca 100644
--- a/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
+++ b/core/lib/Drupal/Core/Field/FieldTypePluginManager.php
@@ -2,10 +2,14 @@
 
 namespace Drupal\Core\Field;
 
+use \Drupal\Core\Field\FieldItemList;
+use \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface;
 use Drupal\Component\Plugin\Factory\DefaultFactory;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field\Annotation\FieldType;
+use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Plugin\CategorizingPluginManagerTrait;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
@@ -40,7 +44,7 @@ class FieldTypePluginManager extends DefaultPluginManager implements FieldTypePl
    *   The typed data manager.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, TypedDataManagerInterface $typed_data_manager) {
-    parent::__construct('Plugin/Field/FieldType', $namespaces, $module_handler, 'Drupal\Core\Field\FieldItemInterface', 'Drupal\Core\Field\Annotation\FieldType');
+    parent::__construct('Plugin/Field/FieldType', $namespaces, $module_handler, FieldItemInterface::class, FieldType::class);
     $this->alterInfo('field_info');
     $this->setCacheBackend($cache_backend, 'field_types_plugins');
     $this->typedDataManager = $typed_data_manager;
@@ -88,7 +92,7 @@ public function createFieldItem(FieldItemListInterface $items, $index, $values =
   public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['list_class'])) {
-      $definition['list_class'] = '\Drupal\Core\Field\FieldItemList';
+      $definition['list_class'] = FieldItemList::class;
     }
 
     // Ensure that every field type has a category.
@@ -134,7 +138,7 @@ public function getUiDefinitions() {
 
     // Add preconfigured definitions.
     foreach ($definitions as $id => $definition) {
-      if (is_subclass_of($definition['class'], '\Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface')) {
+      if (is_subclass_of($definition['class'], PreconfiguredFieldUiOptionsInterface::class)) {
         foreach ($definition['class']::getPreconfiguredOptions() as $key => $option) {
           $definitions['field_ui:' . $id . ':' . $key] = [
             'label' => $option['label'],
diff --git a/core/lib/Drupal/Core/Field/FormatterPluginManager.php b/core/lib/Drupal/Core/Field/FormatterPluginManager.php
index c4df0f5..02a824c 100644
--- a/core/lib/Drupal/Core/Field/FormatterPluginManager.php
+++ b/core/lib/Drupal/Core/Field/FormatterPluginManager.php
@@ -3,8 +3,12 @@
 namespace Drupal\Core\Field;
 
 use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field\Annotation\FieldFormatter;
+use Drupal\Core\Field\FormatterInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 
 /**
@@ -42,7 +46,7 @@ class FormatterPluginManager extends DefaultPluginManager {
    *   The 'field type' plugin manager.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager) {
-    parent::__construct('Plugin/Field/FieldFormatter', $namespaces, $module_handler, 'Drupal\Core\Field\FormatterInterface', 'Drupal\Core\Field\Annotation\FieldFormatter');
+    parent::__construct('Plugin/Field/FieldFormatter', $namespaces, $module_handler, FormatterInterface::class, FieldFormatter::class);
 
     $this->setCacheBackend($cache_backend, 'field_formatter_types_plugins');
     $this->alterInfo('field_formatter_info');
@@ -60,7 +64,7 @@ public function createInstance($plugin_id, array $configuration = []) {
     //   Find a way to restore sanity to
     //   \Drupal\Core\Field\FormatterBase::__construct().
     // If the plugin provides a factory method, pass the container to it.
-    if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
+    if (is_subclass_of($plugin_class, ContainerFactoryPluginInterface::class)) {
       return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
     }
 
@@ -171,7 +175,7 @@ public function getOptions($field_type = NULL) {
       $options = [];
       $field_types = $this->fieldTypeManager->getDefinitions();
       $formatter_types = $this->getDefinitions();
-      uasort($formatter_types, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+      uasort($formatter_types, [SortArray::class, 'sortByWeightElement']);
       foreach ($formatter_types as $name => $formatter_type) {
         foreach ($formatter_type['field_types'] as $formatter_field_type) {
           // Check that the field type exists.
diff --git a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
index de57317..c1bef6e 100644
--- a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
+++ b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Field\Plugin\DataType\Deriver;
 
+use \Drupal\Core\Field\BaseFieldDefinition;
+use \Drupal\Core\Field\TypedData\FieldItemDataDefinition;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -72,8 +74,8 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition)
    */
   public function getDerivativeDefinitions($base_plugin_definition) {
     foreach ($this->fieldTypePluginManager->getDefinitions() as $plugin_id => $definition) {
-      $definition['definition_class'] = '\Drupal\Core\Field\TypedData\FieldItemDataDefinition';
-      $definition['list_definition_class'] = '\Drupal\Core\Field\BaseFieldDefinition';
+      $definition['definition_class'] = FieldItemDataDefinition::class;
+      $definition['list_definition_class'] = BaseFieldDefinition::class;
       $definition['unwrap_for_canonical_representation'] = FALSE;
       $this->derivatives[$plugin_id] = $definition;
     }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
index cf75fac..6b301a3 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Field\Plugin\Field\FieldFormatter;
 
 use Drupal\Core\Field\AllowedTagsXssTrait;
+use Drupal\Core\Field\FieldFilteredMarkup;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
@@ -70,8 +71,8 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
 
       // Account for prefix and suffix.
       if ($this->getSetting('prefix_suffix')) {
-        $prefixes = isset($settings['prefix']) ? array_map(['Drupal\Core\Field\FieldFilteredMarkup', 'create'], explode('|', $settings['prefix'])) : [''];
-        $suffixes = isset($settings['suffix']) ? array_map(['Drupal\Core\Field\FieldFilteredMarkup', 'create'], explode('|', $settings['suffix'])) : [''];
+        $prefixes = isset($settings['prefix']) ? array_map([FieldFilteredMarkup::class, 'create'], explode('|', $settings['prefix'])) : [''];
+        $suffixes = isset($settings['suffix']) ? array_map([FieldFilteredMarkup::class, 'create'], explode('|', $settings['suffix'])) : [''];
         $prefix = (count($prefixes) > 1) ? $this->formatPlural($item->value, $prefixes[0], $prefixes[1]) : $prefixes[0];
         $suffix = (count($suffixes) > 1) ? $this->formatPlural($item->value, $suffixes[0], $suffixes[1]) : $suffixes[0];
         $output = $prefix . $output . $suffix;
diff --git a/core/lib/Drupal/Core/Field/WidgetPluginManager.php b/core/lib/Drupal/Core/Field/WidgetPluginManager.php
index c7c2d79..dee5dfd 100644
--- a/core/lib/Drupal/Core/Field/WidgetPluginManager.php
+++ b/core/lib/Drupal/Core/Field/WidgetPluginManager.php
@@ -3,8 +3,12 @@
 namespace Drupal\Core\Field;
 
 use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field\Annotation\FieldWidget;
+use Drupal\Core\Field\WidgetInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 
 /**
@@ -42,7 +46,7 @@ class WidgetPluginManager extends DefaultPluginManager {
    *   The 'field type' plugin manager.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager) {
-    parent::__construct('Plugin/Field/FieldWidget', $namespaces, $module_handler, 'Drupal\Core\Field\WidgetInterface', 'Drupal\Core\Field\Annotation\FieldWidget');
+    parent::__construct('Plugin/Field/FieldWidget', $namespaces, $module_handler, WidgetInterface::class, FieldWidget::class);
 
     $this->setCacheBackend($cache_backend, 'field_widget_types_plugins');
     $this->alterInfo('field_widget_info');
@@ -118,7 +122,7 @@ public function createInstance($plugin_id, array $configuration = []) {
     $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition);
 
     // If the plugin provides a factory method, pass the container to it.
-    if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
+    if (is_subclass_of($plugin_class, ContainerFactoryPluginInterface::class)) {
       return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
     }
 
@@ -171,7 +175,7 @@ public function getOptions($field_type = NULL) {
       $options = [];
       $field_types = $this->fieldTypeManager->getDefinitions();
       $widget_types = $this->getDefinitions();
-      uasort($widget_types, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+      uasort($widget_types, [SortArray::class, 'sortByWeightElement']);
       foreach ($widget_types as $name => $widget_type) {
         foreach ($widget_type['field_types'] as $widget_field_type) {
           // Check that the field type exists.
diff --git a/core/lib/Drupal/Core/FileTransfer/FTP.php b/core/lib/Drupal/Core/FileTransfer/FTP.php
index 83cf66b..320d0c7 100644
--- a/core/lib/Drupal/Core/FileTransfer/FTP.php
+++ b/core/lib/Drupal/Core/FileTransfer/FTP.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\FileTransfer;
 
+use Drupal\Core\FileTransfer\FTPExtension;
+
 /**
  * Defines the base class for FTP implementations.
  */
@@ -28,7 +30,7 @@ public static function factory($jail, $settings) {
     $port = empty($settings['advanced']['port']) ? 21 : $settings['advanced']['port'];
 
     if (function_exists('ftp_connect')) {
-      $class = 'Drupal\Core\FileTransfer\FTPExtension';
+      $class = FTPExtension::class;
     }
     else {
       throw new FileTransferException('No FTP backend available.');
diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitManager.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitManager.php
index d533647..d896e05 100644
--- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitManager.php
+++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitManager.php
@@ -5,6 +5,8 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\ImageToolkit\Annotation\ImageToolkit;
+use Drupal\Core\ImageToolkit\ImageToolkitInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 
 /**
@@ -38,7 +40,7 @@ class ImageToolkitManager extends DefaultPluginManager {
    *   The config factory.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
-    parent::__construct('Plugin/ImageToolkit', $namespaces, $module_handler, 'Drupal\Core\ImageToolkit\ImageToolkitInterface', 'Drupal\Core\ImageToolkit\Annotation\ImageToolkit');
+    parent::__construct('Plugin/ImageToolkit', $namespaces, $module_handler, ImageToolkitInterface::class, ImageToolkit::class);
 
     $this->setCacheBackend($cache_backend, 'image_toolkit_plugins');
     $this->configFactory = $config_factory;
diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationManager.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationManager.php
index 5fc434c..d71cd66 100644
--- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationManager.php
+++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitOperationManager.php
@@ -4,6 +4,8 @@
 
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\ImageToolkit\Annotation\ImageToolkitOperation;
+use Drupal\Core\ImageToolkit\ImageToolkitOperationInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Component\Plugin\Factory\DefaultFactory;
@@ -50,7 +52,7 @@ class ImageToolkitOperationManager extends DefaultPluginManager implements Image
    *   The image toolkit manager.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LoggerInterface $logger, ImageToolkitManager $toolkit_manager) {
-    parent::__construct('Plugin/ImageToolkit/Operation', $namespaces, $module_handler, 'Drupal\Core\ImageToolkit\ImageToolkitOperationInterface', 'Drupal\Core\ImageToolkit\Annotation\ImageToolkitOperation');
+    parent::__construct('Plugin/ImageToolkit/Operation', $namespaces, $module_handler, ImageToolkitOperationInterface::class, ImageToolkitOperation::class);
 
     $this->alterInfo('image_toolkit_operation');
     $this->setCacheBackend($cache_backend, 'image_toolkit_operation_plugins');
diff --git a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
index 4834149..179e3de 100644
--- a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
+++ b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
@@ -2,9 +2,18 @@
 
 namespace Drupal\Core\Installer;
 
+use Drupal\Core\Cache\MemoryBackendFactory;
+use Drupal\Core\Config\InstallStorage;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
 use Drupal\Core\DependencyInjection\ServiceModifierInterface;
+use Drupal\Core\Installer\InstallerRouteBuilder;
+use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
+use Drupal\Core\KeyValueStore\KeyValueNullExpirableFactory;
+use Drupal\Core\Lock\NullLockBackend;
+use Drupal\Core\PathProcessor\NullPathProcessorManager;
+use Drupal\Core\Routing\NullGenerator;
+use Drupal\Core\Routing\NullMatcherDumper;
 use Symfony\Component\DependencyInjection\Reference;
 
 /**
@@ -23,28 +32,28 @@ public function register(ContainerBuilder $container) {
     // Inject the special configuration storage for the installer.
     // This special implementation MUST NOT be used anywhere else than the early
     // installer environment.
-    $container->register('config.storage', 'Drupal\Core\Config\InstallStorage');
+    $container->register('config.storage', InstallStorage::class);
 
     // Replace services with in-memory implementations.
     $definition = $container->getDefinition('cache_factory');
-    $definition->setClass('Drupal\Core\Cache\MemoryBackendFactory');
+    $definition->setClass(MemoryBackendFactory::class);
     $definition->setArguments([]);
     $definition->setMethodCalls([]);
     $container
-      ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory');
+      ->register('keyvalue', KeyValueMemoryFactory::class);
     $container
-      ->register('keyvalue.expirable', 'Drupal\Core\KeyValueStore\KeyValueNullExpirableFactory');
+      ->register('keyvalue.expirable', KeyValueNullExpirableFactory::class);
 
     // Replace services with no-op implementations.
     $container
-      ->register('lock', 'Drupal\Core\Lock\NullLockBackend');
+      ->register('lock', NullLockBackend::class);
     $container
-      ->register('url_generator', 'Drupal\Core\Routing\NullGenerator')
+      ->register('url_generator', NullGenerator::class)
       ->addArgument(new Reference('request_stack'));
     $container
-      ->register('path_processor_manager', 'Drupal\Core\PathProcessor\NullPathProcessorManager');
+      ->register('path_processor_manager', NullPathProcessorManager::class);
     $container
-      ->register('router.dumper', 'Drupal\Core\Routing\NullMatcherDumper');
+      ->register('router.dumper', NullMatcherDumper::class);
 
     // Remove the cache tags invalidator tag from the cache tags storage, so
     // that we don't call it when cache tags are invalidated very early in the
@@ -55,7 +64,7 @@ public function register(ContainerBuilder $container) {
     // Replace the route builder with an empty implementation.
     // @todo Convert installer steps into routes; add an installer.routing.yml.
     $definition = $container->getDefinition('router.builder');
-    $definition->setClass('Drupal\Core\Installer\InstallerRouteBuilder')
+    $definition->setClass(InstallerRouteBuilder::class)
       // The core router builder, but there is no reason here to be lazy, so
       // we don't need to ship with a custom proxy class.
       ->setLazy(FALSE);
diff --git a/core/lib/Drupal/Core/Mail/MailManager.php b/core/lib/Drupal/Core/Mail/MailManager.php
index 6de2dd8..3b0f69f 100644
--- a/core/lib/Drupal/Core/Mail/MailManager.php
+++ b/core/lib/Drupal/Core/Mail/MailManager.php
@@ -3,11 +3,13 @@
 namespace Drupal\Core\Mail;
 
 use Drupal\Component\Render\PlainTextOutput;
+use Drupal\Core\Annotation\Mail;
 use Drupal\Core\Logger\LoggerChannelFactoryInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Mail\MailInterface;
 use Drupal\Core\Render\RenderContext;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
@@ -72,7 +74,7 @@ class MailManager extends DefaultPluginManager implements MailManagerInterface {
    *   The renderer.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, LoggerChannelFactoryInterface $logger_factory, TranslationInterface $string_translation, RendererInterface $renderer) {
-    parent::__construct('Plugin/Mail', $namespaces, $module_handler, 'Drupal\Core\Mail\MailInterface', 'Drupal\Core\Annotation\Mail');
+    parent::__construct('Plugin/Mail', $namespaces, $module_handler, MailInterface::class, Mail::class);
     $this->alterInfo('mail_backend_info');
     $this->setCacheBackend($cache_backend, 'mail_backend_plugins');
     $this->configFactory = $config_factory;
diff --git a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
index 057f7de..b755997 100644
--- a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
+++ b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Menu;
 
+use \Drupal\Core\Menu\ContextualLinkDefault;
+use \Drupal\Core\Menu\ContextualLinkInterface;
 use Drupal\Component\Plugin\Exception\PluginException;
 use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
@@ -39,7 +41,7 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
     // The weight of the link.
     'weight' => NULL,
     // Default class for contextual link implementations.
-    'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+    'class' => ContextualLinkDefault::class,
     // The plugin id. Set by the plugin system based on the top-level YAML key.
     'id' => '',
   ];
@@ -98,7 +100,7 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
    *   The request stack.
    */
   public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account, RequestStack $request_stack) {
-    $this->factory = new ContainerFactory($this, '\Drupal\Core\Menu\ContextualLinkInterface');
+    $this->factory = new ContainerFactory($this, ContextualLinkInterface::class);
     $this->controllerResolver = $controller_resolver;
     $this->accessManager = $access_manager;
     $this->account = $account;
diff --git a/core/lib/Drupal/Core/Menu/LocalActionManager.php b/core/lib/Drupal/Core/Menu/LocalActionManager.php
index f262d47..68334b8 100644
--- a/core/lib/Drupal/Core/Menu/LocalActionManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalActionManager.php
@@ -7,6 +7,8 @@
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Menu\LocalActionDefault;
+use Drupal\Core\Menu\LocalActionInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Core\Plugin\Discovery\YamlDiscovery;
@@ -44,7 +46,7 @@ class LocalActionManager extends DefaultPluginManager implements LocalActionMana
     // The route names where this local action appears.
     'appears_on' => [],
     // Default class for local action implementations.
-    'class' => 'Drupal\Core\Menu\LocalActionDefault',
+    'class' => LocalActionDefault::class,
   ];
 
   /**
@@ -121,7 +123,7 @@ class LocalActionManager extends DefaultPluginManager implements LocalActionMana
   public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
     // Skip calling the parent constructor, since that assumes annotation-based
     // discovery.
-    $this->factory = new ContainerFactory($this, 'Drupal\Core\Menu\LocalActionInterface');
+    $this->factory = new ContainerFactory($this, LocalActionInterface::class);
     $this->controllerResolver = $controller_resolver;
     $this->requestStack = $request_stack;
     $this->routeMatch = $route_match;
diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
index c14d1de..ad83061 100644
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Menu;
 
+use \Drupal\Core\Menu\LocalTaskInterface;
 use Drupal\Component\Plugin\Exception\PluginException;
 use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Cache\Cache;
@@ -11,6 +12,7 @@
 use Drupal\Core\Controller\ControllerResolverInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Menu\LocalTaskDefault;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Core\Plugin\Discovery\YamlDiscovery;
@@ -45,7 +47,7 @@ class LocalTaskManager extends DefaultPluginManager implements LocalTaskManagerI
     // The default link options.
     'options' => [],
     // Default class for local task implementations.
-    'class' => 'Drupal\Core\Menu\LocalTaskDefault',
+    'class' => LocalTaskDefault::class,
     // The plugin id. Set by the plugin system based on the top-level YAML key.
     'id' => '',
   ];
@@ -129,7 +131,7 @@ class LocalTaskManager extends DefaultPluginManager implements LocalTaskManagerI
    *   The current user.
    */
   public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
-    $this->factory = new ContainerFactory($this, '\Drupal\Core\Menu\LocalTaskInterface');
+    $this->factory = new ContainerFactory($this, LocalTaskInterface::class);
     $this->controllerResolver = $controller_resolver;
     $this->requestStack = $request_stack;
     $this->routeMatch = $route_match;
diff --git a/core/lib/Drupal/Core/Menu/MenuLinkManager.php b/core/lib/Drupal/Core/Menu/MenuLinkManager.php
index e9cd165..194a0dd 100644
--- a/core/lib/Drupal/Core/Menu/MenuLinkManager.php
+++ b/core/lib/Drupal/Core/Menu/MenuLinkManager.php
@@ -6,6 +6,8 @@
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Menu\Form\MenuLinkDefaultForm;
+use Drupal\Core\Menu\MenuLinkDefault;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Core\Plugin\Discovery\YamlDiscovery;
 use Drupal\Core\Plugin\Factory\ContainerFactory;
@@ -53,8 +55,8 @@ class MenuLinkManager implements MenuLinkManagerInterface {
     'provider' => '',
     'metadata' => [],
     // Default class for local task implementations.
-    'class' => 'Drupal\Core\Menu\MenuLinkDefault',
-    'form_class' => 'Drupal\Core\Menu\Form\MenuLinkDefaultForm',
+    'class' => MenuLinkDefault::class,
+    'form_class' => MenuLinkDefaultForm::class,
     // The plugin ID. Set by the plugin system based on the top-level YAML key.
     'id' => '',
   ];
diff --git a/core/lib/Drupal/Core/Path/AliasStorage.php b/core/lib/Drupal/Core/Path/AliasStorage.php
index 4f38012..5cc5723 100644
--- a/core/lib/Drupal/Core/Path/AliasStorage.php
+++ b/core/lib/Drupal/Core/Path/AliasStorage.php
@@ -8,6 +8,8 @@
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\PagerSelectExtender;
+use Drupal\Core\Database\Query\TableSortExtender;
 
 /**
  * Provides a class for CRUD operations on path aliases.
@@ -326,8 +328,8 @@ public function languageAliasExists() {
    */
   public function getAliasesForAdminListing($header, $keys = NULL) {
     $query = $this->connection->select(static::TABLE)
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('Drupal\Core\Database\Query\TableSortExtender');
+      ->extend(PagerSelectExtender::class)
+      ->extend(TableSortExtender::class);
     if ($keys) {
       // Replace wildcards with PDO wildcards.
       $query->condition('alias', '%' . preg_replace('!\*+!', '%', $keys) . '%', 'LIKE');
diff --git a/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php b/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php
index cdacff6..c90bd6c 100644
--- a/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php
+++ b/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\PhpStorage;
 
+use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\StreamWrapper\PublicStream;
 
@@ -38,7 +39,7 @@ public static function get($name) {
       $configuration = $overrides['default'];
     }
     // Make sure all the necessary configuration values are set.
-    $class = isset($configuration['class']) ? $configuration['class'] : 'Drupal\Component\PhpStorage\MTimeProtectedFileStorage';
+    $class = isset($configuration['class']) ? $configuration['class'] : MTimeProtectedFileStorage::class;
     if (!isset($configuration['secret'])) {
       $configuration['secret'] = Settings::getHashSalt();
     }
diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
index 62260a2..5e5fe7a 100644
--- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
+++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Plugin;
 
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Component\Plugin\Definition\PluginDefinitionInterface;
 use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;
 use Drupal\Core\Cache\CacheableDependencyInterface;
@@ -120,7 +121,7 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt
    * @param string[] $additional_annotation_namespaces
    *   (optional) Additional namespaces to scan for annotation definitions.
    */
-  public function __construct($subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $additional_annotation_namespaces = []) {
+  public function __construct($subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = Plugin::class, array $additional_annotation_namespaces = []) {
     $this->subdir = $subdir;
     $this->namespaces = $namespaces;
     $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
index 9ecbaa0..c174c92 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Plugin\Discovery;
 
 use Drupal\Component\Annotation\AnnotationInterface;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery as ComponentAnnotatedClassDiscovery;
 use Drupal\Component\Utility\Unicode;
 
@@ -50,7 +51,7 @@ class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery {
    * @param string[] $annotation_namespaces
    *   (optional) Additional namespaces to scan for annotation definitions.
    */
-  public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) {
+  public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = Plugin::class, array $annotation_namespaces = []) {
     if ($subdir) {
       // Prepend a directory separator to $subdir,
       // if it does not already have one.
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
index 017348e..1d5b908 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Plugin\Discovery;
 
+use \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
 use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
 
 class ContainerDerivativeDiscoveryDecorator extends DerivativeDiscoveryDecorator {
@@ -15,7 +16,7 @@ protected function getDeriver($base_plugin_id, $base_definition) {
       $class = $this->getDeriverClass($base_definition);
       if ($class) {
         // If the deriver provides a factory method, pass the container to it.
-        if (is_subclass_of($class, '\Drupal\Core\Plugin\Discovery\ContainerDeriverInterface')) {
+        if (is_subclass_of($class, ContainerDeriverInterface::class)) {
           /** @var \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface $class */
           $this->derivers[$base_plugin_id] = $class::create(\Drupal::getContainer(), $base_plugin_id);
         }
diff --git a/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php b/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php
index 7aefa59..3ca7a17 100644
--- a/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php
+++ b/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Plugin\Factory;
 
 use Drupal\Component\Plugin\Factory\DefaultFactory;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 
 /**
  * Plugin factory which passes a container to a create method.
@@ -17,7 +18,7 @@ public function createInstance($plugin_id, array $configuration = []) {
     $plugin_class = static::getPluginClass($plugin_id, $plugin_definition, $this->interface);
 
     // If the plugin provides a factory method, pass the container to it.
-    if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
+    if (is_subclass_of($plugin_class, ContainerFactoryPluginInterface::class)) {
       return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
     }
 
diff --git a/core/lib/Drupal/Core/Plugin/PluginManagerPass.php b/core/lib/Drupal/Core/Plugin/PluginManagerPass.php
index 9d4a483..23ca6f6 100644
--- a/core/lib/Drupal/Core/Plugin/PluginManagerPass.php
+++ b/core/lib/Drupal/Core/Plugin/PluginManagerPass.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Plugin;
 
+use \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;
 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
@@ -18,7 +19,7 @@ public function process(ContainerBuilder $container) {
     $cache_clearer_definition = $container->getDefinition('plugin.cache_clearer');
     foreach ($container->getDefinitions() as $service_id => $definition) {
       if (strpos($service_id, 'plugin.manager.') === 0 || $definition->hasTag('plugin_manager_cache_clear')) {
-        if (is_subclass_of($definition->getClass(), '\Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface')) {
+        if (is_subclass_of($definition->getClass(), CachedDiscoveryInterface::class)) {
           $cache_clearer_definition->addMethodCall('addCachedDiscovery', [new Reference($service_id)]);
         }
       }
diff --git a/core/lib/Drupal/Core/Queue/QueueWorkerManager.php b/core/lib/Drupal/Core/Queue/QueueWorkerManager.php
index d9a47b8..ba666c2 100644
--- a/core/lib/Drupal/Core/Queue/QueueWorkerManager.php
+++ b/core/lib/Drupal/Core/Queue/QueueWorkerManager.php
@@ -2,9 +2,11 @@
 
 namespace Drupal\Core\Queue;
 
+use Drupal\Core\Annotation\QueueWorker;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
+use Drupal\Core\Queue\QueueWorkerInterface;
 
 /**
  * Defines the queue worker manager.
@@ -28,7 +30,7 @@ class QueueWorkerManager extends DefaultPluginManager implements QueueWorkerMana
    *   The module handler.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/QueueWorker', $namespaces, $module_handler, 'Drupal\Core\Queue\QueueWorkerInterface', 'Drupal\Core\Annotation\QueueWorker');
+    parent::__construct('Plugin/QueueWorker', $namespaces, $module_handler, QueueWorkerInterface::class, QueueWorker::class);
 
     $this->setCacheBackend($cache_backend, 'queue_plugins');
     $this->alterInfo('queue_info');
diff --git a/core/lib/Drupal/Core/Render/ElementInfoManager.php b/core/lib/Drupal/Core/Render/ElementInfoManager.php
index 015e390..cbae474 100644
--- a/core/lib/Drupal/Core/Render/ElementInfoManager.php
+++ b/core/lib/Drupal/Core/Render/ElementInfoManager.php
@@ -7,6 +7,8 @@
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
+use Drupal\Core\Render\Annotation\RenderElement;
+use Drupal\Core\Render\Element\ElementInterface;
 use Drupal\Core\Render\Element\FormElementInterface;
 use Drupal\Core\Theme\ThemeManagerInterface;
 
@@ -64,7 +66,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
     $this->themeManager = $theme_manager;
     $this->cacheTagInvalidator = $cache_tag_invalidator;
 
-    parent::__construct('Element', $namespaces, $module_handler, 'Drupal\Core\Render\Element\ElementInterface', 'Drupal\Core\Render\Annotation\RenderElement');
+    parent::__construct('Element', $namespaces, $module_handler, ElementInterface::class, RenderElement::class);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 5e329f7..5b71389 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Routing;
 
+use \Drupal\Core\Routing\RouteCompiler;
 use Drupal\Core\Database\SchemaObjectExistsException;
 use Drupal\Core\State\StateInterface;
 use Symfony\Component\Routing\RouteCollection;
@@ -117,7 +118,7 @@ public function dump(array $options = []) {
         $names = [];
         foreach ($routes as $name => $route) {
           /** @var \Symfony\Component\Routing\Route $route */
-          $route->setOption('compiler_class', '\Drupal\Core\Routing\RouteCompiler');
+          $route->setOption('compiler_class', RouteCompiler::class);
           /** @var \Drupal\Core\Routing\CompiledRoute $compiled */
           $compiled = $route->compile();
           // The fit value is a binary number which has 1 at every fixed path
diff --git a/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php b/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php
index 5dfc4b5..6335a74 100644
--- a/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php
+++ b/core/lib/Drupal/Core/Template/TwigSandboxPolicy.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Template;
 
 use Drupal\Core\Site\Settings;
+use Drupal\Core\Template\Attribute;
 
 /**
  * Default sandbox policy for Twig templates.
@@ -40,7 +41,7 @@ public function __construct() {
     $whitelisted_classes = Settings::get('twig_sandbox_whitelisted_classes', [
       // Allow any operations on the Attribute object as it is intended to be
       // changed from a Twig template, for example calling addClass().
-      'Drupal\Core\Template\Attribute',
+      Attribute::class,
     ]);
     // Flip the arrays so we can check using isset().
     $this->whitelisted_classes = array_flip($whitelisted_classes);
diff --git a/core/lib/Drupal/Core/Test/TestRunnerKernel.php b/core/lib/Drupal/Core/Test/TestRunnerKernel.php
index 5be2b83..38ef222 100644
--- a/core/lib/Drupal/Core/Test/TestRunnerKernel.php
+++ b/core/lib/Drupal/Core/Test/TestRunnerKernel.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Installer\InstallerServiceProvider;
 use Drupal\Core\Site\Settings;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -89,7 +90,7 @@ public function discoverServiceProviders() {
     parent::discoverServiceProviders();
     // The test runner does not require an installed Drupal site to exist.
     // Therefore, its environment is identical to that of the early installer.
-    $this->serviceProviderClasses['app']['Test'] = 'Drupal\Core\Installer\InstallerServiceProvider';
+    $this->serviceProviderClasses['app']['Test'] = InstallerServiceProvider::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/TypedData/Annotation/DataType.php b/core/lib/Drupal/Core/TypedData/Annotation/DataType.php
index 5c3c42f..0f33638 100644
--- a/core/lib/Drupal/Core/TypedData/Annotation/DataType.php
+++ b/core/lib/Drupal/Core/TypedData/Annotation/DataType.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Core\TypedData\Annotation;
 
+use \Drupal\Core\TypedData\DataDefinition;
+use \Drupal\Core\TypedData\ListDataDefinition;
+use \Drupal\Core\TypedData\Plugin\DataType\ItemList;
 use Drupal\Component\Annotation\Plugin;
 
 /**
@@ -64,7 +67,7 @@ class DataType extends Plugin {
    *
    * @var string
    */
-  public $definition_class = '\Drupal\Core\TypedData\DataDefinition';
+  public $definition_class = DataDefinition::class;
 
   /**
    * The typed data class used for wrapping multiple data items of the type.
@@ -72,7 +75,7 @@ class DataType extends Plugin {
    *
    * @var string
    */
-  public $list_class = '\Drupal\Core\TypedData\Plugin\DataType\ItemList';
+  public $list_class = ItemList::class;
 
   /**
    * The definition class to use for defining a list of items of this type.
@@ -80,7 +83,7 @@ class DataType extends Plugin {
    *
    * @var string
    */
-  public $list_definition_class = '\Drupal\Core\TypedData\ListDataDefinition';
+  public $list_definition_class = ListDataDefinition::class;
 
   /**
    * The pre-defined primitive type that this data type maps to.
diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
index dbf0d5f..3ab70f2 100644
--- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php
+++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
@@ -2,12 +2,15 @@
 
 namespace Drupal\Core\TypedData;
 
+use \Drupal\Core\TypedData\PrimitiveInterface;
 use Drupal\Component\Plugin\Exception\PluginException;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
+use Drupal\Core\TypedData\OptionsProviderInterface;
+use Drupal\Core\TypedData\Annotation\DataType;
 use Drupal\Core\TypedData\Validation\ExecutionContextFactory;
 use Drupal\Core\TypedData\Validation\RecursiveValidator;
 use Drupal\Core\Validation\ConstraintManager;
@@ -67,7 +70,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
     $this->setCacheBackend($cache_backend, 'typed_data_types_plugins');
     $this->classResolver = $class_resolver;
 
-    parent::__construct('Plugin/DataType', $namespaces, $module_handler, NULL, 'Drupal\Core\TypedData\Annotation\DataType');
+    parent::__construct('Plugin/DataType', $namespaces, $module_handler, NULL, DataType::class);
   }
 
   /**
@@ -249,7 +252,7 @@ public function getDefaultConstraints(DataDefinitionInterface $definition) {
     $type_definition = $this->getDefinition($definition->getDataType());
     // Auto-generate a constraint for data types implementing a primitive
     // interface.
-    if (is_subclass_of($type_definition['class'], '\Drupal\Core\TypedData\PrimitiveInterface')) {
+    if (is_subclass_of($type_definition['class'], PrimitiveInterface::class)) {
       $constraints['PrimitiveType'] = [];
     }
     // Add in constraints specified by the data type.
@@ -261,7 +264,7 @@ public function getDefaultConstraints(DataDefinitionInterface $definition) {
       $constraints['NotNull'] = [];
     }
     // Check if the class provides allowed values.
-    if (is_subclass_of($definition->getClass(), 'Drupal\Core\TypedData\OptionsProviderInterface')) {
+    if (is_subclass_of($definition->getClass(), OptionsProviderInterface::class)) {
       $constraints['AllowedValues'] = [];
     }
     return $constraints;
diff --git a/core/lib/Drupal/Core/Update/UpdateKernel.php b/core/lib/Drupal/Core/Update/UpdateKernel.php
index 4608f18..97832d0 100644
--- a/core/lib/Drupal/Core/Update/UpdateKernel.php
+++ b/core/lib/Drupal/Core/Update/UpdateKernel.php
@@ -5,6 +5,7 @@
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Session\AnonymousUserSession;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\Update\UpdateServiceProvider;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\ParameterBag;
 use Symfony\Component\HttpFoundation\Request;
@@ -27,7 +28,7 @@ class UpdateKernel extends DrupalKernel {
   public function discoverServiceProviders() {
     parent::discoverServiceProviders();
 
-    $this->serviceProviderClasses['app']['update_kernel'] = 'Drupal\Core\Update\UpdateServiceProvider';
+    $this->serviceProviderClasses['app']['update_kernel'] = UpdateServiceProvider::class;
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Update/UpdateServiceProvider.php b/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
index ad3d4df..ed17c83 100644
--- a/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
+++ b/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Update;
 
+use Drupal\Core\Cache\NullBackend;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceModifierInterface;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
@@ -17,7 +18,7 @@ class UpdateServiceProvider implements ServiceProviderInterface, ServiceModifier
    * {@inheritdoc}
    */
   public function register(ContainerBuilder $container) {
-    $definition = new Definition('Drupal\Core\Cache\NullBackend', ['null']);
+    $definition = new Definition(NullBackend::class, ['null']);
     $container->setDefinition('cache.null', $definition);
   }
 
diff --git a/core/lib/Drupal/Core/Validation/ConstraintManager.php b/core/lib/Drupal/Core/Validation/ConstraintManager.php
index a2bd604..5e61138 100644
--- a/core/lib/Drupal/Core/Validation/ConstraintManager.php
+++ b/core/lib/Drupal/Core/Validation/ConstraintManager.php
@@ -2,11 +2,16 @@
 
 namespace Drupal\Core\Validation;
 
+use \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint;
+use \Symfony\Component\Validator\Constraints\Blank;
+use \Symfony\Component\Validator\Constraints\Callback;
+use \Symfony\Component\Validator\Constraints\NotBlank;
 use Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\Validation\Annotation\Constraint;
 
 /**
  * Constraint plugin manager.
@@ -40,7 +45,7 @@ class ConstraintManager extends DefaultPluginManager {
    *   The module handler to invoke the alter hook with.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/Validation/Constraint', $namespaces, $module_handler, NULL, 'Drupal\Core\Validation\Annotation\Constraint');
+    parent::__construct('Plugin/Validation/Constraint', $namespaces, $module_handler, NULL, Constraint::class);
     $this->alterInfo('validation_constraint');
     $this->setCacheBackend($cache_backend, 'validation_constraint_plugins');
   }
@@ -87,22 +92,22 @@ public function create($name, $options) {
   public function registerDefinitions() {
     $this->getDiscovery()->setDefinition('Callback', [
       'label' => new TranslatableMarkup('Callback'),
-      'class' => '\Symfony\Component\Validator\Constraints\Callback',
+      'class' => Callback::class,
       'type' => FALSE,
     ]);
     $this->getDiscovery()->setDefinition('Blank', [
       'label' => new TranslatableMarkup('Blank'),
-      'class' => '\Symfony\Component\Validator\Constraints\Blank',
+      'class' => Blank::class,
       'type' => FALSE,
     ]);
     $this->getDiscovery()->setDefinition('NotBlank', [
       'label' => new TranslatableMarkup('Not blank'),
-      'class' => '\Symfony\Component\Validator\Constraints\NotBlank',
+      'class' => NotBlank::class,
       'type' => FALSE,
     ]);
     $this->getDiscovery()->setDefinition('Email', [
       'label' => new TranslatableMarkup('Email'),
-      'class' => '\Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint',
+      'class' => EmailConstraint::class,
       'type' => ['string'],
     ]);
   }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/CountConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/CountConstraint.php
index a7f5dd5..e9b4031 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/CountConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/CountConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\CountValidator;
 use Symfony\Component\Validator\Constraints\Count;
 
 /**
@@ -25,7 +26,7 @@ class CountConstraint extends Count {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\CountValidator';
+    return CountValidator::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
index 179ee9a..fd4ccf1 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\EmailValidator;
 use Symfony\Component\Validator\Constraints\Email;
 
 /**
@@ -22,7 +23,7 @@ class EmailConstraint extends Email {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\EmailValidator';
+    return EmailValidator::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php
index 2aaca39..be5f63f 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\LengthValidator;
 use Symfony\Component\Validator\Constraints\Length;
 
 /**
@@ -27,7 +28,7 @@ class LengthConstraint extends Length {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\LengthValidator';
+    return LengthValidator::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php
index afa7154..450c07c 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\RangeValidator;
 use Symfony\Component\Validator\Constraints\Range;
 
 /**
@@ -26,7 +27,7 @@ class RangeConstraint extends Range {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\RangeValidator';
+    return RangeValidator::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php
index 63c6682..36adc07 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\RegexValidator;
 use Symfony\Component\Validator\Constraints\Regex;
 
 /**
@@ -22,7 +23,7 @@ class RegexConstraint extends Regex {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\RegexValidator';
+    return RegexValidator::class;
   }
 
 }
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UniqueFieldConstraint.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UniqueFieldConstraint.php
index ed40bdc..5a6bf2d 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UniqueFieldConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UniqueFieldConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
+use \Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldValueValidator;
 use Symfony\Component\Validator\Constraint;
 
 /**
@@ -20,7 +21,7 @@ class UniqueFieldConstraint extends Constraint {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldValueValidator';
+    return UniqueFieldValueValidator::class;
   }
 
 }
diff --git a/core/modules/action/src/Form/ActionAdminManageForm.php b/core/modules/action/src/Form/ActionAdminManageForm.php
index 478e919..28dc5ebd 100644
--- a/core/modules/action/src/Form/ActionAdminManageForm.php
+++ b/core/modules/action/src/Form/ActionAdminManageForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\action\Form;
 
+use \Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Action\ActionManager;
@@ -52,7 +53,7 @@ public function getFormId() {
   public function buildForm(array $form, FormStateInterface $form_state) {
     $actions = [];
     foreach ($this->manager->getDefinitions() as $id => $definition) {
-      if (is_subclass_of($definition['class'], '\Drupal\Core\Plugin\PluginFormInterface')) {
+      if (is_subclass_of($definition['class'], PluginFormInterface::class)) {
         $key = Crypt::hashBase64($id);
         $actions[$key] = $definition['label'] . '...';
       }
diff --git a/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php b/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
index 8df0e93..cf9d0b3 100644
--- a/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
+++ b/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\block\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Plugin\DefaultLazyPluginCollection;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\Core\Plugin\Fixtures\TestConfigurablePlugin;
 use Drupal\Tests\UnitTestCase;
@@ -46,18 +50,18 @@ class BlockConfigEntityUnitTest extends UnitTestCase {
   protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('block'));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -80,7 +84,7 @@ public function testCalculateDependencies() {
     $instance = new TestConfigurablePlugin([], $instance_id, ['provider' => 'test']);
 
     // Create a plugin collection to contain the instance.
-    $plugin_collection = $this->getMockBuilder('\Drupal\Core\Plugin\DefaultLazyPluginCollection')
+    $plugin_collection = $this->getMockBuilder(DefaultLazyPluginCollection::class)
       ->disableOriginalConstructor()
       ->setMethods(['get'])
       ->getMock();
diff --git a/core/modules/block/tests/src/Unit/BlockFormTest.php b/core/modules/block/tests/src/Unit/BlockFormTest.php
index b846349..086e5a3 100644
--- a/core/modules/block/tests/src/Unit/BlockFormTest.php
+++ b/core/modules/block/tests/src/Unit/BlockFormTest.php
@@ -3,6 +3,13 @@
 namespace Drupal\Tests\block\Unit;
 
 use Drupal\block\BlockForm;
+use Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\Executable\ExecutableManagerInterface;
+use Drupal\Core\Extension\ThemeHandlerInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Plugin\Context\ContextRepositoryInterface;
 use Drupal\Core\Plugin\PluginFormFactoryInterface;
 use Drupal\Tests\UnitTestCase;
 
@@ -68,13 +75,13 @@ class BlockFormTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->conditionManager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
-    $this->language = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
-    $this->contextRepository = $this->getMock('Drupal\Core\Plugin\Context\ContextRepositoryInterface');
+    $this->conditionManager = $this->getMock(ExecutableManagerInterface::class);
+    $this->language = $this->getMock(LanguageManagerInterface::class);
+    $this->contextRepository = $this->getMock(ContextRepositoryInterface::class);
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
-    $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->storage = $this->getMock(ConfigEntityStorageInterface::class);
+    $this->themeHandler = $this->getMock(ThemeHandlerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getStorage')
       ->will($this->returnValue($this->storage));
@@ -95,7 +102,7 @@ public function testGetUniqueMachineName() {
     $blocks['other_test_1'] = $this->getBlockMockWithMachineName('other_test');
     $blocks['other_test_2'] = $this->getBlockMockWithMachineName('other_test');
 
-    $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $query = $this->getMock(QueryInterface::class);
     $query->expects($this->exactly(5))
       ->method('condition')
       ->will($this->returnValue($query));
diff --git a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
index 5584b0b..325b010 100644
--- a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
+++ b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
@@ -10,7 +10,12 @@
 use Drupal\block\BlockRepository;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Block\BlockPluginInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Plugin\Context\ContextHandlerInterface;
 use Drupal\Core\Plugin\ContextAwarePluginInterface;
+use Drupal\Core\Theme\ActiveTheme;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -44,7 +49,7 @@ class BlockRepositoryTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $active_theme = $this->getMockBuilder('Drupal\Core\Theme\ActiveTheme')
+    $active_theme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->theme = $this->randomMachineName();
@@ -59,14 +64,14 @@ protected function setUp() {
         'bottom',
       ]);
 
-    $theme_manager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
+    $theme_manager = $this->getMock(ThemeManagerInterface::class);
     $theme_manager->expects($this->atLeastOnce())
       ->method('getActiveTheme')
       ->will($this->returnValue($active_theme));
 
-    $this->contextHandler = $this->getMock('Drupal\Core\Plugin\Context\ContextHandlerInterface');
-    $this->blockStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->contextHandler = $this->getMock(ContextHandlerInterface::class);
+    $this->blockStorage = $this->getMock(EntityStorageInterface::class);
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->any())
       ->method('getStorage')
       ->willReturn($this->blockStorage);
diff --git a/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php b/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
index d91ebbc..8b30c1a 100644
--- a/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
+++ b/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Utility\Html;
 use Drupal\block\Controller\CategoryAutocompleteController;
+use Drupal\Core\Block\BlockManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -21,7 +22,7 @@ class CategoryAutocompleteTest extends UnitTestCase {
   protected $autocompleteController;
 
   protected function setUp() {
-    $block_manager = $this->getMock('Drupal\Core\Block\BlockManagerInterface');
+    $block_manager = $this->getMock(BlockManagerInterface::class);
     $block_manager->expects($this->any())
       ->method('getCategories')
       ->will($this->returnValue(['Comment', 'Node', 'None & Such', 'User']));
diff --git a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
index 6d7dbf2..4159665 100644
--- a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
+++ b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\block\Unit\Menu;
 
+use Drupal\Core\Extension\ThemeHandlerInterface;
 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -40,7 +41,7 @@ protected function setUp() {
         'name' => 'test_c',
       ],
     ];
-    $theme_handler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
+    $theme_handler = $this->getMock(ThemeHandlerInterface::class);
     $theme_handler->expects($this->any())
       ->method('listInfo')
       ->will($this->returnValue($themes));
diff --git a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
index 1569411..d67a44c 100644
--- a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
@@ -2,8 +2,13 @@
 
 namespace Drupal\Tests\block\Unit\Plugin\DisplayVariant;
 
+use Drupal\Core\Block\BlockPluginInterface;
+use Drupal\Core\Block\MainContentBlockPluginInterface;
+use Drupal\Core\Block\MessagesBlockPluginInterface;
+use Drupal\Core\Block\TitleBlockPluginInterface;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\DependencyInjection\Container;
+use Drupal\Core\Entity\EntityViewBuilderInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -57,7 +62,7 @@ public function setUpDisplayVariant($configuration = [], $definition = []) {
     \Drupal::setContainer($container);
 
     $this->blockRepository = $this->getMock('Drupal\block\BlockRepositoryInterface');
-    $this->blockViewBuilder = $this->getMock('Drupal\Core\Entity\EntityViewBuilderInterface');
+    $this->blockViewBuilder = $this->getMock(EntityViewBuilderInterface::class);
 
     return $this->getMockBuilder('Drupal\block\Plugin\DisplayVariant\BlockPageVariant')
       ->setConstructorArgs([$configuration, 'test', $definition, $this->blockRepository, $this->blockViewBuilder, ['config:block_list']])
@@ -203,10 +208,10 @@ public function testBuild(array $blocks_config, $visible_block_count, array $exp
     $display_variant->setMainContent(['#markup' => 'Hello kittens!']);
 
     $blocks = ['top' => [], 'center' => [], 'bottom' => []];
-    $block_plugin = $this->getMock('Drupal\Core\Block\BlockPluginInterface');
-    $main_content_block_plugin = $this->getMock('Drupal\Core\Block\MainContentBlockPluginInterface');
-    $messages_block_plugin = $this->getMock('Drupal\Core\Block\MessagesBlockPluginInterface');
-    $title_block_plugin = $this->getMock('Drupal\Core\Block\TitleBlockPluginInterface');
+    $block_plugin = $this->getMock(BlockPluginInterface::class);
+    $main_content_block_plugin = $this->getMock(MainContentBlockPluginInterface::class);
+    $messages_block_plugin = $this->getMock(MessagesBlockPluginInterface::class);
+    $title_block_plugin = $this->getMock(TitleBlockPluginInterface::class);
     foreach ($blocks_config as $block_id => $block_config) {
       $block = $this->getMock('Drupal\block\BlockInterface');
       $block->expects($this->any())
diff --git a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
index ced7e84..56abb80 100644
--- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
+++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\block_content\Unit\Menu;
 
+use Drupal\Core\Extension\ThemeHandlerInterface;
 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -39,7 +40,7 @@ protected function setUp() {
         'name' => 'test_c',
       ],
     ];
-    $theme_handler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
+    $theme_handler = $this->getMock(ThemeHandlerInterface::class);
     $theme_handler->expects($this->any())
       ->method('listInfo')
       ->will($this->returnValue($themes));
diff --git a/core/modules/book/tests/src/Unit/BookManagerTest.php b/core/modules/book/tests/src/Unit/BookManagerTest.php
index 98dbd5a..a37ac20 100644
--- a/core/modules/book/tests/src/Unit/BookManagerTest.php
+++ b/core/modules/book/tests/src/Unit/BookManagerTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\Tests\book\Unit;
 
+use \Drupal\Core\Render\RendererInterface;
 use Drupal\book\BookManager;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -57,11 +59,11 @@ class BookManagerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->translation = $this->getStringTranslationStub();
     $this->configFactory = $this->getConfigFactoryStub([]);
     $this->bookOutlineStorage = $this->getMock('Drupal\book\BookOutlineStorageInterface');
-    $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
     $this->bookManager = new BookManager($this->entityManager, $this->translation, $this->configFactory, $this->bookOutlineStorage, $this->renderer);
   }
 
diff --git a/core/modules/breakpoint/src/BreakpointManager.php b/core/modules/breakpoint/src/BreakpointManager.php
index 30caf27..012a05e 100644
--- a/core/modules/breakpoint/src/BreakpointManager.php
+++ b/core/modules/breakpoint/src/BreakpointManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\breakpoint;
 
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -159,7 +160,7 @@ public function getBreakpointsByGroup($group) {
             $breakpoints[$plugin_id] = $plugin_definition;
           }
         }
-        uasort($breakpoints, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+        uasort($breakpoints, [SortArray::class, 'sortByWeightElement']);
         $this->cacheBackend->set($this->cacheKey . ':' . $group, $breakpoints, Cache::PERMANENT, ['breakpoints']);
         $this->breakpointsByGroup[$group] = $breakpoints;
       }
diff --git a/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php b/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
index 4b8fd88..0cdc245 100644
--- a/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
+++ b/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
@@ -5,6 +5,7 @@
 use Drupal\breakpoint\Breakpoint;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 
 /**
  * @coversDefaultClass \Drupal\breakpoint\Breakpoint
@@ -45,7 +46,7 @@ class BreakpointTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $this->stringTranslation = $this->getMock(TranslationInterface::class);
   }
 
   /**
diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php
index d164d8a..fd39f03 100644
--- a/core/modules/comment/src/CommentStorage.php
+++ b/core/modules/comment/src/CommentStorage.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityInterface;
@@ -272,7 +273,7 @@ public function loadThread(EntityInterface $entity, $field_name, $mode, $comment
       ->addMetaData('field_name', $field_name);
 
     if ($comments_per_page) {
-      $query = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      $query = $query->extend(PagerSelectExtender::class)
         ->limit($comments_per_page);
       if ($pager_id) {
         $query->element($pager_id);
diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
index 8a0a0f5..7c013e0 100644
--- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\comment\Unit;
 
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Extension\ModuleHandlerInterface;
+use \Drupal\Core\Field\FieldDefinitionInterface;
+use \Drupal\Core\Session\AccountProxyInterface;
 use Drupal\comment\CommentLinkBuilder;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Core\Url;
@@ -70,9 +74,9 @@ class CommentLinkBuilderTest extends UnitTestCase {
   protected function setUp() {
     $this->commentManager = $this->getMock('\Drupal\comment\CommentManagerInterface');
     $this->stringTranslation = $this->getStringTranslationStub();
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
-    $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->currentUser = $this->getMock('\Drupal\Core\Session\AccountProxyInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->currentUser = $this->getMock(AccountProxyInterface::class);
     $this->commentLinkBuilder = new CommentLinkBuilder($this->currentUser, $this->commentManager, $this->moduleHandler, $this->stringTranslation, $this->entityManager);
     $this->commentManager->expects($this->any())
       ->method('getFields')
@@ -286,7 +290,7 @@ protected function getMockNode($has_field, $comment_status, $form_location, $com
       ->with('comment')
       ->willReturn($field_item);
 
-    $field_definition = $this->getMock('\Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->any())
       ->method('getSetting')
       ->with('form_location')
diff --git a/core/modules/comment/tests/src/Unit/CommentManagerTest.php b/core/modules/comment/tests/src/Unit/CommentManagerTest.php
index 3a6e201..38a387b 100644
--- a/core/modules/comment/tests/src/Unit/CommentManagerTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentManagerTest.php
@@ -3,7 +3,14 @@
 namespace Drupal\Tests\comment\Unit;
 
 use Drupal\comment\CommentManager;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Entity\ContentEntityTypeInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Routing\UrlGeneratorInterface;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -19,7 +26,7 @@ class CommentManagerTest extends UnitTestCase {
    */
   public function testGetFields() {
     // Set up a content entity type.
-    $entity_type = $this->getMock('Drupal\Core\Entity\ContentEntityTypeInterface');
+    $entity_type = $this->getMock(ContentEntityTypeInterface::class);
     $entity_type->expects($this->any())
       ->method('getClass')
       ->will($this->returnValue('Node'));
@@ -28,7 +35,7 @@ public function testGetFields() {
       ->with(FieldableEntityInterface::class)
       ->will($this->returnValue(TRUE));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
 
     $entity_manager->expects($this->once())
       ->method('getFieldMapByFieldType')
@@ -46,11 +53,11 @@ public function testGetFields() {
 
     $comment_manager = new CommentManager(
       $entity_manager,
-      $this->getMock('Drupal\Core\Config\ConfigFactoryInterface'),
-      $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'),
-      $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface'),
-      $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'),
-      $this->getMock('Drupal\Core\Session\AccountInterface')
+      $this->getMock(ConfigFactoryInterface::class),
+      $this->getMock(TranslationInterface::class),
+      $this->getMock(UrlGeneratorInterface::class),
+      $this->getMock(ModuleHandlerInterface::class),
+      $this->getMock(AccountInterface::class)
     );
     $comment_fields = $comment_manager->getFields('node');
     $this->assertArrayHasKey('field_foobar', $comment_fields);
diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
index 2a6d379..8c7401e 100644
--- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
@@ -3,6 +3,12 @@
 namespace Drupal\Tests\comment\Unit;
 
 use Drupal\comment\CommentStatistics;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Driver\sqlite\Statement;
+use Drupal\Core\Database\Query\Select;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -50,7 +56,7 @@ class CommentStatisticsUnitTest extends UnitTestCase {
    * Sets up required mocks and the CommentStatistics service under test.
    */
   protected function setUp() {
-    $this->statement = $this->getMockBuilder('Drupal\Core\Database\Driver\sqlite\Statement')
+    $this->statement = $this->getMockBuilder(Statement::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -58,7 +64,7 @@ protected function setUp() {
       ->method('fetchObject')
       ->will($this->returnCallback([$this, 'fetchObjectCallback']));
 
-    $this->select = $this->getMockBuilder('Drupal\Core\Database\Query\Select')
+    $this->select = $this->getMockBuilder(Select::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -74,7 +80,7 @@ protected function setUp() {
       ->method('execute')
       ->will($this->returnValue($this->statement));
 
-    $this->database = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $this->database = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -82,7 +88,7 @@ protected function setUp() {
       ->method('select')
       ->will($this->returnValue($this->select));
 
-    $this->commentStatistics = new CommentStatistics($this->database, $this->getMock('Drupal\Core\Session\AccountInterface'), $this->getMock('Drupal\Core\Entity\EntityManagerInterface'), $this->getMock('Drupal\Core\State\StateInterface'));
+    $this->commentStatistics = new CommentStatistics($this->database, $this->getMock(AccountInterface::class), $this->getMock(EntityManagerInterface::class), $this->getMock(StateInterface::class));
   }
 
   /**
diff --git a/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php b/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
index e724dc6..c718f92 100644
--- a/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
+++ b/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
@@ -2,7 +2,14 @@
 
 namespace Drupal\Tests\comment\Unit\Entity;
 
+use \Drupal\Core\Entity\ContentEntityInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Cache\CacheTagsInvalidator;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -19,15 +26,15 @@ class CommentLockTest extends UnitTestCase {
    */
   public function testLocks() {
     $container = new ContainerBuilder();
-    $container->set('module_handler', $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'));
-    $container->set('current_user', $this->getMock('Drupal\Core\Session\AccountInterface'));
-    $container->set('cache.test', $this->getMock('Drupal\Core\Cache\CacheBackendInterface'));
+    $container->set('module_handler', $this->getMock(ModuleHandlerInterface::class));
+    $container->set('current_user', $this->getMock(AccountInterface::class));
+    $container->set('cache.test', $this->getMock(CacheBackendInterface::class));
     $container->set('comment.statistics', $this->getMock('Drupal\comment\CommentStatisticsInterface'));
     $request_stack = new RequestStack();
     $request_stack->push(Request::create('/'));
     $container->set('request_stack', $request_stack);
     $container->setParameter('cache_bins', ['cache.test' => 'test']);
-    $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+    $lock = $this->getMock(LockBackendInterface::class);
     $cid = 2;
     $lock_name = "comment:$cid:.00/";
     $lock->expects($this->at(0))
@@ -41,7 +48,7 @@ public function testLocks() {
       ->method($this->anything());
     $container->set('lock', $lock);
 
-    $cache_tag_invalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidator');
+    $cache_tag_invalidator = $this->getMock(CacheTagsInvalidator::class);
     $container->set('cache_tags.invalidator', $cache_tag_invalidator);
 
     \Drupal::setContainer($container);
@@ -69,7 +76,7 @@ public function testLocks() {
       ->method('getThread')
       ->will($this->returnValue(''));
 
-    $parent_entity = $this->getMock('\Drupal\Core\Entity\ContentEntityInterface');
+    $parent_entity = $this->getMock(ContentEntityInterface::class);
     $parent_entity->expects($this->atLeastOnce())
       ->method('getCacheTagsToInvalidate')
       ->willReturn(['node:1']);
@@ -77,7 +84,7 @@ public function testLocks() {
       ->method('getCommentedEntity')
       ->willReturn($parent_entity);
 
-    $entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $comment->expects($this->any())
       ->method('getEntityType')
       ->will($this->returnValue($entity_type));
diff --git a/core/modules/config/src/Tests/ConfigEntityListTest.php b/core/modules/config/src/Tests/ConfigEntityListTest.php
index e9950ea..b621728 100644
--- a/core/modules/config/src/Tests/ConfigEntityListTest.php
+++ b/core/modules/config/src/Tests/ConfigEntityListTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\SortArray;
 use Drupal\simpletest\WebTestBase;
 use Drupal\config_test\Entity\ConfigTest;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -70,7 +71,7 @@ public function testList() {
 
     $actual_operations = $controller->getOperations($entity);
     // Sort the operations to normalize link order.
-    uasort($actual_operations, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+    uasort($actual_operations, [SortArray::class, 'sortByWeightElement']);
     $this->assertEqual($expected_operations, $actual_operations, 'The operations are identical.');
 
     // Test buildHeader() method.
@@ -140,7 +141,7 @@ public function testList() {
 
     $actual_operations = $controller->getOperations($entity);
     // Sort the operations to normalize link order.
-    uasort($actual_operations, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+    uasort($actual_operations, [SortArray::class, 'sortByWeightElement']);
     $this->assertEqual($expected_operations, $actual_operations, 'The operations are identical.');
   }
 
diff --git a/core/modules/config/src/Tests/ConfigInstallProfileUnmetDependenciesTest.php b/core/modules/config/src/Tests/ConfigInstallProfileUnmetDependenciesTest.php
index 6683580..7fc404c 100644
--- a/core/modules/config/src/Tests/ConfigInstallProfileUnmetDependenciesTest.php
+++ b/core/modules/config/src/Tests/ConfigInstallProfileUnmetDependenciesTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\config\Tests;
 
 use Drupal\Core\Config\InstallStorage;
+use Drupal\Core\Config\UnmetDependenciesException;
 use Drupal\Core\Serialization\Yaml;
 use Drupal\simpletest\InstallerTestBase;
 
@@ -65,7 +66,7 @@ protected function error($message = '', $group = 'Other', array $caller = NULL)
       // set the message to a status of 'debug'.
       return $this->assert('debug', $message, 'Debug', $caller);
     }
-    if ($group == 'Drupal\Core\Config\UnmetDependenciesException') {
+    if ($group == UnmetDependenciesException::class) {
       $this->expectedException = TRUE;
       return FALSE;
     }
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
index 11e72c2..6bebd30 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
@@ -3,6 +3,12 @@
 namespace Drupal\Tests\config_translation\Unit;
 
 use Drupal\config_translation\ConfigEntityMapper;
+use Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
+use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
@@ -50,11 +56,11 @@ class ConfigEntityMapperTest extends UnitTestCase {
   protected $languageManager;
 
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $this->entity = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $this->entity = $this->getMock(ConfigEntityInterface::class);
 
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
 
     $this->routeProvider
       ->expects($this->any())
@@ -71,13 +77,13 @@ protected function setUp() {
       'route_name' => 'config_translation.item.overview.entity.configurable_language.edit_form',
     ];
 
-    $typed_config_manager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $typed_config_manager = $this->getMock(TypedConfigManagerInterface::class);
 
     $locale_config_manager = $this->getMockBuilder('Drupal\locale\LocaleConfigManager')
       ->disableOriginalConstructor()
       ->getMock();
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
 
     $this->configEntityMapper = new ConfigEntityMapper(
       'configurable_language',
@@ -103,7 +109,7 @@ public function testEntityGetterAndSetter() {
       ->with()
       ->will($this->returnValue('entity_id'));
 
-    $entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $entity_type
       ->expects($this->any())
       ->method('getConfigPrefix')
@@ -136,7 +142,7 @@ public function testEntityGetterAndSetter() {
    * Tests ConfigEntityMapper::getOverviewRouteParameters().
    */
   public function testGetOverviewRouteParameters() {
-    $entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $this->entityManager
       ->expects($this->once())
       ->method('getDefinition')
@@ -167,7 +173,7 @@ public function testGetType() {
    * Tests ConfigEntityMapper::getTypeName().
    */
   public function testGetTypeName() {
-    $entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('getLabel')
       ->will($this->returnValue('test'));
@@ -185,7 +191,7 @@ public function testGetTypeName() {
    * Tests ConfigEntityMapper::getTypeLabel().
    */
   public function testGetTypeLabel() {
-    $entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('getLabel')
       ->will($this->returnValue('test'));
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
index 8e6d0b9..1886674 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
@@ -3,6 +3,11 @@
 namespace Drupal\Tests\config_translation\Unit;
 
 use Drupal\config_translation\ConfigFieldMapper;
+use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -39,7 +44,7 @@ class ConfigFieldMapperTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entity = $this->getMock('Drupal\field\FieldConfigInterface');
 
     $definition = [
@@ -58,13 +63,13 @@ protected function setUp() {
       'node_fields',
       $definition,
       $this->getConfigFactoryStub(),
-      $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface'),
+      $this->getMock(TypedConfigManagerInterface::class),
       $locale_config_manager,
       $this->getMock('Drupal\config_translation\ConfigMapperManagerInterface'),
-      $this->getMock('Drupal\Core\Routing\RouteProviderInterface'),
+      $this->getMock(RouteProviderInterface::class),
       $this->getStringTranslationStub(),
       $this->entityManager,
-      $this->getMock('Drupal\Core\Language\LanguageManagerInterface')
+      $this->getMock(LanguageManagerInterface::class)
     );
   }
 
@@ -74,7 +79,7 @@ protected function setUp() {
    * @covers ::setEntity
    */
   public function testSetEntity() {
-    $entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $entity_type
       ->expects($this->any())
       ->method('getConfigPrefix')
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php b/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
index 9f064ac..a8ecde4 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
@@ -3,8 +3,14 @@
 namespace Drupal\Tests\config_translation\Unit;
 
 use Drupal\config_translation\ConfigMapperManager;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Config\Schema\Mapping;
+use Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Extension\ThemeHandlerInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\TypedData\DataDefinition;
@@ -32,20 +38,20 @@ class ConfigMapperManagerTest extends UnitTestCase {
 
   protected function setUp() {
     $language = new Language(['id' => 'en']);
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
     $language_manager->expects($this->once())
       ->method('getCurrentLanguage')
       ->with(LanguageInterface::TYPE_INTERFACE)
       ->will($this->returnValue($language));
 
-    $this->typedConfigManager = $this->getMockBuilder('Drupal\Core\Config\TypedConfigManagerInterface')
+    $this->typedConfigManager = $this->getMockBuilder(TypedConfigManagerInterface::class)
       ->getMock();
 
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $theme_handler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
+    $theme_handler = $this->getMock(ThemeHandlerInterface::class);
 
     $this->configMapperManager = new ConfigMapperManager(
-      $this->getMock('Drupal\Core\Cache\CacheBackendInterface'),
+      $this->getMock(CacheBackendInterface::class),
       $language_manager,
       $module_handler,
       $this->typedConfigManager,
@@ -140,7 +146,7 @@ public function providerTestHasTranslatable() {
    */
   protected function getElement(array $definition) {
     $data_definition = new DataDefinition($definition);
-    $element = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $element = $this->getMock(TypedDataInterface::class);
     $element->expects($this->any())
       ->method('getDataDefinition')
       ->will($this->returnValue($data_definition));
@@ -163,7 +169,7 @@ protected function getNestedElement(array $elements) {
     // in order for getIterator() to be called. Therefore we need to mock
     // \Drupal\Core\Config\Schema\ArrayElement, but that is abstract, so we
     // need to mock one of the subclasses of it.
-    $nested_element = $this->getMockBuilder('Drupal\Core\Config\Schema\Mapping')
+    $nested_element = $this->getMockBuilder(Mapping::class)
       ->disableOriginalConstructor()
       ->getMock();
     $nested_element->expects($this->once())
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
index e7a0679..58ec108 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
@@ -9,9 +9,13 @@
 
 use Drupal\config_translation\ConfigNamesMapper;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Routing\RouteMatch;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
@@ -89,7 +93,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
   protected $languageManager;
 
   protected function setUp() {
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
 
     $this->pluginDefinition = [
       'class' => '\Drupal\config_translation\ConfigNamesMapper',
@@ -99,7 +103,7 @@ protected function setUp() {
       'weight' => 42,
     ];
 
-    $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfigManager = $this->getMock(TypedConfigManagerInterface::class);
 
     $this->localeConfigManager = $this->getMockBuilder('Drupal\locale\LocaleConfigManager')
       ->disableOriginalConstructor()
@@ -107,7 +111,7 @@ protected function setUp() {
 
     $this->configMapperManager = $this->getMock('Drupal\config_translation\ConfigMapperManagerInterface');
 
-    $this->urlGenerator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
     $container = new ContainerBuilder();
     $container->set('url_generator', $this->urlGenerator);
     \Drupal::setContainer($container);
@@ -120,7 +124,7 @@ protected function setUp() {
       ->with('system.site_information_settings')
       ->will($this->returnValue($this->baseRoute));
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
 
     $this->configNamesMapper = new TestConfigNamesMapper(
       'system.site_information_settings',
diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
index 898ea22..e91e521 100644
--- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php
+++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
@@ -2,6 +2,11 @@
 
 namespace Drupal\Tests\contact\Unit;
 
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityStorageInterface;
+use \Drupal\Core\Language\LanguageManagerInterface;
+use \Drupal\Core\Mail\MailManagerInterface;
+use \Psr\Log\LoggerInterface;
 use Drupal\contact\MailHandler;
 use Drupal\contact\MailHandlerException;
 use Drupal\contact\MessageInterface;
@@ -69,11 +74,11 @@ class MailHandlerTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->mailManager = $this->getMock('\Drupal\Core\Mail\MailManagerInterface');
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
-    $this->logger = $this->getMock('\Psr\Log\LoggerInterface');
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
-    $this->userStorage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $this->mailManager = $this->getMock(MailManagerInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
+    $this->logger = $this->getMock(LoggerInterface::class);
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->userStorage = $this->getMock(EntityStorageInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getStorage')
       ->with('user')
@@ -108,7 +113,7 @@ public function testInvalidRecipient() {
     $message->expects($this->once())
       ->method('getContactForm')
       ->willReturn($this->getMock('\Drupal\contact\ContactFormInterface'));
-    $sender = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $sender = $this->getMock(\Drupal\Core\Session\AccountInterface::class);
     $this->userStorage->expects($this->any())
       ->method('load')
       ->willReturn($sender);
@@ -290,7 +295,7 @@ public function getSendMailMessages() {
    *   Mock sender for testing.
    */
   protected function getMockSender($anonymous = TRUE, $mail_address = 'anonymous@drupal.org') {
-    $sender = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $sender = $this->getMock(\Drupal\Core\Session\AccountInterface::class);
     $sender->expects($this->once())
       ->method('isAnonymous')
       ->willReturn($anonymous);
diff --git a/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php b/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
index ad7317f..624bf52 100644
--- a/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
+++ b/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
@@ -6,7 +6,13 @@
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 
@@ -32,7 +38,7 @@ class ContentTranslationManageAccessCheckTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->cacheContextsManager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $this->cacheContextsManager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->cacheContextsManager->method('assertValidTokens')->willReturn(TRUE);
@@ -54,7 +60,7 @@ public function testCreateAccess() {
       ->method('getTranslationAccess')
       ->will($this->returnValue(AccessResult::allowed()));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->once())
       ->method('getHandler')
       ->withAnyParameters()
@@ -65,7 +71,7 @@ public function testCreateAccess() {
     $target = 'it';
 
     // Set the mock language manager.
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
     $language_manager->expects($this->at(0))
       ->method('getLanguage')
       ->with($this->equalTo($source))
@@ -84,7 +90,7 @@ public function testCreateAccess() {
 
     // Set the mock entity. We need to use ContentEntityBase for mocking due to
     // issues with phpunit and multiple interfaces.
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity->expects($this->once())
@@ -111,14 +117,14 @@ public function testCreateAccess() {
     $route->setRequirement('_access_content_translation_manage', 'create');
 
     // Set up the route match.
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->once())
       ->method('getParameter')
       ->with('node')
       ->will($this->returnValue($entity));
 
     // Set the mock account.
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
 
     // The access check under test.
     $check = new ContentTranslationManageAccessCheck($entity_manager, $language_manager);
diff --git a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
index a72d9b7..52428ee 100644
--- a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
+++ b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\content_translation\Unit\Menu;
 
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
 
 /**
@@ -18,7 +19,7 @@ protected function setUp() {
     ];
     parent::setUp();
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->any())
       ->method('getLinkTemplate')
       ->will($this->returnValueMap([
diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
index 10e2af8..ee3ac1c 100644
--- a/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\dblog\Controller;
 
+use \Drupal\Core\Database\Query\PagerSelectExtender;
+use \Drupal\Core\Database\Query\TableSortExtender;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\Xss;
@@ -152,8 +154,8 @@ public function overview() {
     ];
 
     $query = $this->database->select('watchdog', 'w')
-      ->extend('\Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('\Drupal\Core\Database\Query\TableSortExtender');
+      ->extend(PagerSelectExtender::class)
+      ->extend(TableSortExtender::class);
     $query->fields('w', [
       'wid',
       'uid',
@@ -386,8 +388,8 @@ public function topLogMessages($type) {
     $count_query->condition('type', $type);
 
     $query = $this->database->select('watchdog', 'w')
-      ->extend('\Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('\Drupal\Core\Database\Query\TableSortExtender');
+      ->extend(PagerSelectExtender::class)
+      ->extend(TableSortExtender::class);
     $query->addExpression('COUNT(wid)', 'count');
     $query = $query
       ->fields('w', ['message', 'variables'])
diff --git a/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php b/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
index 4e96f4a..2b62f04 100644
--- a/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
+++ b/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
@@ -2,7 +2,12 @@
 
 namespace Drupal\Tests\editor\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\editor\Entity\Editor;
 use Drupal\Tests\UnitTestCase;
 
@@ -61,18 +66,18 @@ protected function setUp() {
     $this->editorId = $this->randomMachineName();
     $this->entityTypeId = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('editor'));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $this->editorPluginManager = $this->getMockBuilder('Drupal\editor\Plugin\EditorManager')
       ->disableOriginalConstructor()
@@ -109,12 +114,12 @@ public function testCalculateDependencies() {
 
     $entity = new Editor($values, $this->entityTypeId);
 
-    $filter_format = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $filter_format = $this->getMock(ConfigEntityInterface::class);
     $filter_format->expects($this->once())
       ->method('getConfigDependencyName')
       ->will($this->returnValue('filter.format.test'));
 
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('load')
       ->with($format_id)
diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php b/core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php
index 8105a22..de28e57 100644
--- a/core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php
+++ b/core/modules/field/tests/modules/field_test/src/Plugin/Validation/Constraint/TestFieldConstraint.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\field_test\Plugin\Validation\Constraint;
 
+use \Symfony\Component\Validator\Constraints\NotEqualToValidator;
 use Symfony\Component\Validator\Constraints\NotEqualTo;
 
 /**
@@ -26,7 +27,7 @@ public function getRequiredOptions() {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Symfony\Component\Validator\Constraints\NotEqualToValidator';
+    return NotEqualToValidator::class;
   }
 
 }
diff --git a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
index d1824cf..803d7fa 100644
--- a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
+++ b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
@@ -7,8 +7,15 @@
 
 namespace Drupal\Tests\field\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Core\Entity\EntityType;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\Tests\UnitTestCase;
@@ -73,15 +80,15 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
    */
   protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
-    $this->entityType = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $this->entityType = $this->getMock(ConfigEntityTypeInterface::class);
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
-    $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfigManager = $this->getMock(TypedConfigManagerInterface::class);
 
-    $this->fieldTypePluginManager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $this->fieldTypePluginManager = $this->getMock(FieldTypePluginManagerInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -115,7 +122,7 @@ protected function setUp() {
    */
   public function testCalculateDependencies() {
     // Mock the interfaces necessary to create a dependency on a bundle entity.
-    $target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $target_entity_type = $this->getMock(EntityTypeInterface::class);
     $target_entity_type->expects($this->any())
       ->method('getBundleConfigDependency')
       ->will($this->returnValue(['type' => 'config', 'name' => 'test.test_entity_type.id']));
@@ -162,7 +169,7 @@ public function testCalculateDependencies() {
    * Test that invalid bundles are handled.
    */
   public function testCalculateDependenciesIncorrectBundle() {
-    $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
+    $storage = $this->getMock(ConfigEntityStorageInterface::class);
     $storage->expects($this->any())
       ->method('load')
       ->with('test_bundle_not_exists')
diff --git a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
index 89b7396..b3fc123 100644
--- a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
+++ b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
@@ -7,6 +7,10 @@
 
 namespace Drupal\Tests\field\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Field\FieldException;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
@@ -53,8 +57,8 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->uuid = $this->getMock(UuidInterface::class);
     $this->fieldTypeManager = $this->getMock(FieldTypePluginManagerInterface::class);
 
     $container = new ContainerBuilder();
@@ -69,14 +73,14 @@ protected function setUp() {
    */
   public function testCalculateDependencies() {
     // Create a mock entity type for FieldStorageConfig.
-    $fieldStorageConfigentityType = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $fieldStorageConfigentityType = $this->getMock(ConfigEntityTypeInterface::class);
     $fieldStorageConfigentityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('field'));
 
     // Create a mock entity type to attach the field to.
     $attached_entity_type_id = $this->randomMachineName();
-    $attached_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $attached_entity_type = $this->getMock(EntityTypeInterface::class);
     $attached_entity_type->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('entity_provider_module'));
diff --git a/core/modules/field_ui/src/Element/FieldUiTable.php b/core/modules/field_ui/src/Element/FieldUiTable.php
index 84cafb0..b090f39 100644
--- a/core/modules/field_ui/src/Element/FieldUiTable.php
+++ b/core/modules/field_ui/src/Element/FieldUiTable.php
@@ -3,6 +3,7 @@
 namespace Drupal\field_ui\Element;
 
 use Drupal\Component\Utility\Html;
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Render\Element\Table;
 
@@ -229,7 +230,7 @@ public static function reduceOrder($array, $a) {
       $array[] = $a['name'];
     }
     if (!empty($a['children'])) {
-      uasort($a['children'], ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+      uasort($a['children'], [SortArray::class, 'sortByWeightElement']);
       $array = array_merge($array, array_reduce($a['children'], [static::class, 'reduceOrder']));
     }
 
diff --git a/core/modules/field_ui/tests/src/Unit/FieldUiTest.php b/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
index 19e1244..c4ab18a 100644
--- a/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
+++ b/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\field_ui\Unit;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Path\PathValidatorInterface;
 use Drupal\field_ui\FieldUI;
 use Drupal\Tests\UnitTestCase;
 
@@ -26,7 +27,7 @@ class FieldUiTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->pathValidator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $this->pathValidator = $this->getMock(PathValidatorInterface::class);
     $container = new ContainerBuilder();
     $container->set('path.validator', $this->pathValidator);
     \Drupal::setContainer($container);
diff --git a/core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php b/core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php
index 080e46f..ee90110 100644
--- a/core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php
+++ b/core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\file\Plugin\Validation\Constraint;
 
+use \Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldValueValidator;
 use Symfony\Component\Validator\Constraint;
 
 /**
@@ -20,7 +21,7 @@ class FileUriUnique extends Constraint {
    * {@inheritdoc}
    */
   public function validatedBy() {
-    return '\Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldValueValidator';
+    return UniqueFieldValueValidator::class;
   }
 
 }
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
index 240c9e0..fee4e83 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\file\Kernel\Migrate\d7;
 
+use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\Core\StreamWrapper\StreamWrapperInterface;
 use Drupal\file\Entity\File;
 use Drupal\file\FileInterface;
@@ -23,7 +24,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->installEntitySchema('file');
-    $this->container->get('stream_wrapper_manager')->registerWrapper('public', 'Drupal\Core\StreamWrapper\PublicStream', StreamWrapperInterface::NORMAL);
+    $this->container->get('stream_wrapper_manager')->registerWrapper('public', PublicStream::class, StreamWrapperInterface::NORMAL);
 
     $fs = \Drupal::service('file_system');
     // The public file directory active during the test will serve as the
diff --git a/core/modules/forum/src/ForumManager.php b/core/modules/forum/src/ForumManager.php
index 05cd860..ff966bb 100644
--- a/core/modules/forum/src/ForumManager.php
+++ b/core/modules/forum/src/ForumManager.php
@@ -4,6 +4,8 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Query\PagerSelectExtender;
+use Drupal\Core\Database\Query\TableSortExtender;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -149,8 +151,8 @@ public function getTopics($tid, AccountInterface $account) {
     }
 
     $query = $this->connection->select('forum_index', 'f')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('Drupal\Core\Database\Query\TableSortExtender');
+      ->extend(PagerSelectExtender::class)
+      ->extend(TableSortExtender::class);
     $query->fields('f');
     $query
       ->condition('f.tid', $tid)
@@ -176,7 +178,7 @@ public function getTopics($tid, AccountInterface $account) {
       $nodes = $this->entityManager->getStorage('node')->loadMultiple($nids);
 
       $query = $this->connection->select('node_field_data', 'n')
-        ->extend('Drupal\Core\Database\Query\TableSortExtender');
+        ->extend(TableSortExtender::class);
       $query->fields('n', ['nid']);
 
       $query->join('comment_entity_statistics', 'ces', "n.nid = ces.entity_id AND ces.field_name = 'comment_forum' AND ces.entity_type = 'node'");
diff --git a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumBreadcrumbBuilderBaseTest.php b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumBreadcrumbBuilderBaseTest.php
index abc1122..71b4119 100644
--- a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumBreadcrumbBuilderBaseTest.php
+++ b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumBreadcrumbBuilderBaseTest.php
@@ -3,7 +3,12 @@
 namespace Drupal\Tests\forum\Unit\Breadcrumb;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Link;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Container;
 
@@ -19,7 +24,7 @@ class ForumBreadcrumbBuilderBaseTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -35,14 +40,14 @@ protected function setUp() {
    */
   public function testConstructor() {
     // Make some test doubles.
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $config_factory = $this->getConfigFactoryStub(
       [
         'forum.settings' => ['IAmATestKey' => 'IAmATestValue'],
       ]
     );
     $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface');
-    $translation_manager = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $translation_manager = $this->getMock(TranslationInterface::class);
 
     // Make an object to test.
     $builder = $this->getMockForAbstractClass(
@@ -85,7 +90,7 @@ public function testConstructor() {
    */
   public function testBuild() {
     // Build all our dependencies, backwards.
-    $translation_manager = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationInterface')
+    $translation_manager = $this->getMockBuilder(TranslationInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -100,14 +105,14 @@ public function testBuild() {
     $prophecy->getCacheContexts()->willReturn([]);
     $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
 
-    $vocab_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $vocab_storage = $this->getMock(EntityStorageInterface::class);
     $vocab_storage->expects($this->any())
       ->method('load')
       ->will($this->returnValueMap([
         ['forums', $prophecy->reveal()],
       ]));
 
-    $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface')
+    $entity_manager = $this->getMockBuilder(EntityManagerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity_manager->expects($this->any())
@@ -141,7 +146,7 @@ public function testBuild() {
     $breadcrumb_builder->setStringTranslation($translation_manager);
 
     // Our empty data set.
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
 
     // Expected result set.
     $expected = [
diff --git a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php
index 45566f2..9367a7d 100644
--- a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php
+++ b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php
@@ -3,7 +3,12 @@
 namespace Drupal\Tests\forum\Unit\Breadcrumb;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Link;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Container;
 
@@ -19,7 +24,7 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -43,10 +48,10 @@ protected function setUp() {
    */
   public function testApplies($expected, $route_name = NULL, $parameter_map = []) {
     // Make some test doubles.
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $config_factory = $this->getConfigFactoryStub([]);
     $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface');
-    $translation_manager = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $translation_manager = $this->getMock(TranslationInterface::class);
 
     // Make an object to test.
     $builder = $this->getMockBuilder('Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder')
@@ -59,7 +64,7 @@ public function testApplies($expected, $route_name = NULL, $parameter_map = [])
       ->setMethods(NULL)
       ->getMock();
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->once())
       ->method('getRouteName')
       ->will($this->returnValue($route_name));
@@ -118,7 +123,7 @@ public function providerTestApplies() {
    */
   public function testBuild() {
     // Build all our dependencies, backwards.
-    $translation_manager = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationInterface')
+    $translation_manager = $this->getMockBuilder(TranslationInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -153,14 +158,14 @@ public function testBuild() {
     $prophecy->getCacheTags()->willReturn(['taxonomy_vocabulary:5']);
     $prophecy->getCacheContexts()->willReturn([]);
     $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
-    $vocab_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $vocab_storage = $this->getMock(EntityStorageInterface::class);
     $vocab_storage->expects($this->any())
       ->method('load')
       ->will($this->returnValueMap([
         ['forums', $prophecy->reveal()],
       ]));
 
-    $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface')
+    $entity_manager = $this->getMockBuilder(EntityManagerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity_manager->expects($this->any())
@@ -201,7 +206,7 @@ public function testBuild() {
     $forum_listing = $prophecy->reveal();
 
     // Our data set.
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->exactly(2))
       ->method('getParameter')
       ->with('taxonomy_term')
diff --git a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php
index f4d3797..c0c9eeb 100644
--- a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php
+++ b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php
@@ -3,7 +3,12 @@
 namespace Drupal\Tests\forum\Unit\Breadcrumb;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Link;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Container;
 
@@ -19,7 +24,7 @@ class ForumNodeBreadcrumbBuilderTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -43,7 +48,7 @@ protected function setUp() {
    */
   public function testApplies($expected, $route_name = NULL, $parameter_map = []) {
     // Make some test doubles.
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $config_factory = $this->getConfigFactoryStub([]);
 
     $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface');
@@ -51,7 +56,7 @@ public function testApplies($expected, $route_name = NULL, $parameter_map = [])
       ->method('checkNodeType')
       ->will($this->returnValue(TRUE));
 
-    $translation_manager = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $translation_manager = $this->getMock(TranslationInterface::class);
 
     // Make an object to test.
     $builder = $this->getMockBuilder('Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder')
@@ -66,7 +71,7 @@ public function testApplies($expected, $route_name = NULL, $parameter_map = [])
       ->setMethods(NULL)
       ->getMock();
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->once())
       ->method('getRouteName')
       ->will($this->returnValue($route_name));
@@ -126,7 +131,7 @@ public function providerTestApplies() {
    */
   public function testBuild() {
     // Build all our dependencies, backwards.
-    $translation_manager = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationInterface')
+    $translation_manager = $this->getMockBuilder(TranslationInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -162,14 +167,14 @@ public function testBuild() {
     $prophecy->getCacheTags()->willReturn(['taxonomy_vocabulary:5']);
     $prophecy->getCacheContexts()->willReturn([]);
     $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT);
-    $vocab_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $vocab_storage = $this->getMock(EntityStorageInterface::class);
     $vocab_storage->expects($this->any())
       ->method('load')
       ->will($this->returnValueMap([
         ['forums', $prophecy->reveal()],
       ]));
 
-    $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface')
+    $entity_manager = $this->getMockBuilder(EntityManagerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity_manager->expects($this->any())
@@ -208,7 +213,7 @@ public function testBuild() {
       ->getMock();
 
     // Our data set.
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->exactly(2))
       ->method('getParameter')
       ->with('node')
diff --git a/core/modules/forum/tests/src/Unit/ForumManagerTest.php b/core/modules/forum/tests/src/Unit/ForumManagerTest.php
index ad59092..90c934a 100644
--- a/core/modules/forum/tests/src/Unit/ForumManagerTest.php
+++ b/core/modules/forum/tests/src/Unit/ForumManagerTest.php
@@ -2,6 +2,11 @@
 
 namespace Drupal\Tests\forum\Unit;
 
+use \Drupal\Core\Config\Config;
+use \Drupal\Core\Config\ConfigFactoryInterface;
+use \Drupal\Core\Database\Connection;
+use \Drupal\Core\StringTranslation\TranslationManager;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -14,15 +19,15 @@ class ForumManagerTest extends UnitTestCase {
    * Tests ForumManager::getIndex().
    */
   public function testGetIndex() {
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
 
     $storage = $this->getMockBuilder('\Drupal\taxonomy\VocabularyStorage')
       ->disableOriginalConstructor()
       ->getMock();
 
-    $config_factory = $this->getMock('\Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
 
-    $config = $this->getMockBuilder('\Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -45,11 +50,11 @@ public function testGetIndex() {
       ->method('create')
       ->will($this->returnValue($term));
 
-    $connection = $this->getMockBuilder('\Drupal\Core\Database\Connection')
+    $connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
 
-    $translation_manager = $this->getMockBuilder('\Drupal\Core\StringTranslation\TranslationManager')
+    $translation_manager = $this->getMockBuilder(TranslationManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/modules/hal/src/HalServiceProvider.php b/core/modules/hal/src/HalServiceProvider.php
index d2b4028..c2dd777 100644
--- a/core/modules/hal/src/HalServiceProvider.php
+++ b/core/modules/hal/src/HalServiceProvider.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\hal;
 
+use \Drupal\Core\StackMiddleware\NegotiationMiddleware;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceModifierInterface;
 
@@ -14,7 +15,7 @@ class HalServiceProvider implements ServiceModifierInterface {
    * {@inheritdoc}
    */
   public function alter(ContainerBuilder $container) {
-    if ($container->has('http_middleware.negotiation') && is_a($container->getDefinition('http_middleware.negotiation')->getClass(), '\Drupal\Core\StackMiddleware\NegotiationMiddleware', TRUE)) {
+    if ($container->has('http_middleware.negotiation') && is_a($container->getDefinition('http_middleware.negotiation')->getClass(), NegotiationMiddleware::class, TRUE)) {
       $container->getDefinition('http_middleware.negotiation')->addMethodCall('registerFormat', ['hal_json', ['application/hal+json']]);
     }
   }
diff --git a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
index 1fc118d..3ff817a 100644
--- a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -3,6 +3,7 @@
 namespace Drupal\hal\Normalizer;
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -22,7 +23,7 @@ class ContentEntityNormalizer extends NormalizerBase {
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\Entity\ContentEntityInterface';
+  protected $supportedInterfaceOrClass = ContentEntityInterface::class;
 
   /**
    * The hypermedia link manager.
diff --git a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
index fbcae8c..06878ad 100644
--- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
+++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
@@ -3,6 +3,7 @@
 namespace Drupal\hal\Normalizer;
 
 use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\hal\LinkManager\LinkManagerInterface;
 use Drupal\serialization\EntityResolver\EntityResolverInterface;
 use Drupal\serialization\EntityResolver\UuidReferenceInterface;
@@ -17,7 +18,7 @@ class EntityReferenceItemNormalizer extends FieldItemNormalizer implements UuidR
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem';
+  protected $supportedInterfaceOrClass = EntityReferenceItem::class;
 
   /**
    * The hypermedia link manager.
diff --git a/core/modules/hal/src/Normalizer/FieldItemNormalizer.php b/core/modules/hal/src/Normalizer/FieldItemNormalizer.php
index 0c2ee9e..69464f3 100644
--- a/core/modules/hal/src/Normalizer/FieldItemNormalizer.php
+++ b/core/modules/hal/src/Normalizer/FieldItemNormalizer.php
@@ -15,7 +15,7 @@ class FieldItemNormalizer extends NormalizerBase {
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\Field\FieldItemInterface';
+  protected $supportedInterfaceOrClass = FieldItemInterface::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php b/core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php
index d1a3b9b..9e0c132 100644
--- a/core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php
+++ b/core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\hal\Unit;
 
+use \Drupal\Core\Field\Plugin\DataType\FieldItem;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -18,7 +19,7 @@
    * @return array Test data.
    */
   public function providerNormalizerDenormalizeExceptions() {
-    $mock = $this->getMock('\Drupal\Core\Field\Plugin\DataType\FieldItem', ['getParent']);
+    $mock = $this->getMock(FieldItem::class, ['getParent']);
     $mock->expects($this->any())
       ->method('getParent')
       ->will($this->returnValue(NULL));
diff --git a/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php
index 28d5179..9373705 100644
--- a/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php
+++ b/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php
@@ -64,7 +64,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
     $extensions = \Drupal::service('image.toolkit.manager')->getDefaultToolkit()->getSupportedExtensions();
     $options = array_combine(
       $extensions,
-      array_map(['\Drupal\Component\Utility\Unicode', 'strtoupper'], $extensions)
+      array_map([\Drupal\Component\Utility\Unicode::class, 'strtoupper'], $extensions)
     );
     $form['extension'] = [
       '#type' => 'select',
diff --git a/core/modules/image/tests/src/Unit/ImageStyleTest.php b/core/modules/image/tests/src/Unit/ImageStyleTest.php
index bc954b3..4374334 100644
--- a/core/modules/image/tests/src/Unit/ImageStyleTest.php
+++ b/core/modules/image/tests/src/Unit/ImageStyleTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\image\Unit;
 
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Psr\Log\LoggerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Component\Utility\Crypt;
 
@@ -88,11 +91,11 @@ protected function getImageStyleMock($image_effect_id, $image_effect, $stubs = [
   protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
     $this->provider = $this->randomMachineName();
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue($this->provider));
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
@@ -104,7 +107,7 @@ protected function setUp() {
    */
   public function testGetDerivativeExtension() {
     $image_effect_id = $this->randomMachineName();
-    $logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
+    $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
     $image_effect = $this->getMockBuilder('\Drupal\image\ImageEffectBase')
       ->setConstructorArgs([[], $image_effect_id, [], $logger])
       ->getMock();
@@ -127,7 +130,7 @@ public function testGetDerivativeExtension() {
   public function testBuildUri() {
     // Image style that changes the extension.
     $image_effect_id = $this->randomMachineName();
-    $logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
+    $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
     $image_effect = $this->getMockBuilder('\Drupal\image\ImageEffectBase')
       ->setConstructorArgs([[], $image_effect_id, [], $logger])
       ->getMock();
@@ -155,7 +158,7 @@ public function testBuildUri() {
    * @covers ::getPathToken
    */
   public function testGetPathToken() {
-    $logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
+    $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
     $private_key = $this->randomMachineName();
     $hash_salt = $this->randomMachineName();
 
diff --git a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
index 6533090..44ccee3 100644
--- a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
+++ b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\image\Unit\PageCache;
 
 use Drupal\Core\PageCache\ResponsePolicyInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\image\PageCache\DenyPrivateImageStyleDownload;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -43,7 +44,7 @@ class DenyPrivateImageStyleDownloadTest extends UnitTestCase {
   protected $routeMatch;
 
   protected function setUp() {
-    $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $this->routeMatch = $this->getMock(RouteMatchInterface::class);
     $this->policy = new DenyPrivateImageStyleDownload($this->routeMatch);
     $this->response = new Response();
     $this->request = new Request();
diff --git a/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
index 92ab889..b295365 100644
--- a/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
+++ b/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\language\Kernel;
 
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Url;
 
 /**
@@ -49,7 +50,7 @@ protected function setUp() {
    * @covers ::getLanguageSwitchLinks
    */
   public function testLanguageSwitchLinks() {
-    $this->languageNegotiator->setCurrentUser($this->prophesize('Drupal\Core\Session\AccountInterface')->reveal());
+    $this->languageNegotiator->setCurrentUser($this->prophesize(AccountInterface::class)->reveal());
     $this->languageManager->getLanguageSwitchLinks(LanguageInterface::TYPE_INTERFACE, new Url('<current>'));
   }
 
diff --git a/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php b/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
index 805cef9..4388dc2 100644
--- a/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
+++ b/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\language\Unit\Config;
 
+use \Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\language\Config\LanguageConfigOverride;
 use Drupal\Tests\UnitTestCase;
@@ -52,11 +55,11 @@ class LanguageConfigOverrideTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
+    $this->storage = $this->getMock(StorageInterface::class);
     $this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfig = $this->getMock(TypedConfigManagerInterface::class);
     $this->configTranslation = new LanguageConfigOverride('config.test', $this->storage, $this->typedConfig, $this->eventDispatcher);
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator);
diff --git a/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php b/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
index 06820d0..3f5af75 100644
--- a/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
+++ b/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
@@ -2,8 +2,13 @@
 
 namespace Drupal\Tests\language\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\language\Entity\ContentLanguageSettings;
 use Drupal\Tests\UnitTestCase;
 
@@ -60,15 +65,15 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
    */
   protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
-    $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfigManager = $this->getMock(TypedConfigManagerInterface::class);
 
-    $this->configEntityStorageInterface = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $this->configEntityStorageInterface = $this->getMock(EntityStorageInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -83,7 +88,7 @@ protected function setUp() {
    */
   public function testCalculateDependencies() {
     // Mock the interfaces necessary to create a dependency on a bundle entity.
-    $target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $target_entity_type = $this->getMock(EntityTypeInterface::class);
     $target_entity_type->expects($this->any())
       ->method('getBundleConfigDependency')
       ->will($this->returnValue(['type' => 'config', 'name' => 'test.test_entity_type.id']));
diff --git a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
index 825ca7d..e690caf 100644
--- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
@@ -3,8 +3,10 @@
 namespace Drupal\Tests\language\Unit;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\BubbleableMetadata;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -25,11 +27,11 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
   protected function setUp() {
 
     // Set up some languages to be used by the language-based path processor.
-    $language_de = $this->getMock('\Drupal\Core\Language\LanguageInterface');
+    $language_de = $this->getMock(\Drupal\Core\Language\LanguageInterface::class);
     $language_de->expects($this->any())
       ->method('getId')
       ->will($this->returnValue('de'));
-    $language_en = $this->getMock('\Drupal\Core\Language\LanguageInterface');
+    $language_en = $this->getMock(\Drupal\Core\Language\LanguageInterface::class);
     $language_en->expects($this->any())
       ->method('getId')
       ->will($this->returnValue('en'));
@@ -48,10 +50,10 @@ protected function setUp() {
     $this->languageManager = $language_manager;
 
     // Create a user stub.
-    $this->user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface')
+    $this->user = $this->getMockBuilder(AccountInterface::class)
       ->getMock();
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
diff --git a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php
index c2290bc..4a7ccd6 100644
--- a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\link\Unit\Plugin\Validation\Constraint;
 
+use Drupal\Core\Session\AccountProxyInterface;
+use Drupal\Core\Url;
 use Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraint;
 use Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraintValidator;
 use Drupal\Tests\UnitTestCase;
@@ -68,7 +70,7 @@ public function providerValidate() {
 
     foreach ($cases as $case) {
       // Mock a Url object that returns a boolean indicating user access.
-      $url = $this->getMockBuilder('Drupal\Core\Url')
+      $url = $this->getMockBuilder(Url::class)
         ->disableOriginalConstructor()
         ->getMock();
       $url->expects($this->once())
@@ -81,7 +83,7 @@ public function providerValidate() {
         ->willReturn($url);
       // Mock a user object that returns a boolean indicating user access to all
       // links.
-      $user = $this->getMock('Drupal\Core\Session\AccountProxyInterface');
+      $user = $this->getMock(AccountProxyInterface::class);
       $user->expects($this->any())
         ->method('hasPermission')
         ->with($this->equalTo('link to any page'))
diff --git a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php
index 41ecd4a..fe84ebc 100644
--- a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\link\Unit\Plugin\Validation\Constraint;
 
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Url;
 use Drupal\link\Plugin\Validation\Constraint\LinkNotExistingInternalConstraint;
 use Drupal\link\Plugin\Validation\Constraint\LinkNotExistingInternalConstraintValidator;
@@ -51,7 +52,7 @@ public function providerValidate() {
     // Existing routed URL.
     $url = Url::fromRoute('example.existing_route');
 
-    $url_generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $url_generator = $this->getMock(UrlGeneratorInterface::class);
     $url_generator->expects($this->any())
       ->method('generateFromRoute')
       ->with('example.existing_route', [], [])
@@ -63,7 +64,7 @@ public function providerValidate() {
     // Not existing routed URL.
     $url = Url::fromRoute('example.not_existing_route');
 
-    $url_generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $url_generator = $this->getMock(UrlGeneratorInterface::class);
     $url_generator->expects($this->any())
       ->method('generateFromRoute')
       ->with('example.not_existing_route', [], [])
diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php
index 45bf41d..02671b6 100644
--- a/core/modules/locale/src/StringDatabaseStorage.php
+++ b/core/modules/locale/src/StringDatabaseStorage.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 
 /**
  * Defines a class to store localized strings in the database.
@@ -443,7 +444,7 @@ protected function dbStringSelect(array $conditions, array $options = []) {
     }
 
     if (!empty($options['pager limit'])) {
-      $query = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit($options['pager limit']);
+      $query = $query->extend(PagerSelectExtender::class)->limit($options['pager limit']);
     }
 
     return $query;
diff --git a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
index cbdd6de..edca69c 100644
--- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
@@ -2,7 +2,11 @@
 
 namespace Drupal\Tests\locale\Unit;
 
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\locale\LocaleLookup;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -68,19 +72,19 @@ class LocaleLookupTest extends UnitTestCase {
    */
   protected function setUp() {
     $this->storage = $this->getMock('Drupal\locale\StringStorageInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
     $this->lock->expects($this->never())
       ->method($this->anything());
 
-    $this->user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->user = $this->getMock(AccountInterface::class);
     $this->user->expects($this->any())
       ->method('getRoles')
       ->will($this->returnValue(['anonymous']));
 
     $this->configFactory = $this->getConfigFactoryStub(['locale.settings' => ['cache_strings' => FALSE]]);
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->requestStack = new RequestStack();
 
     $container = new ContainerBuilder();
diff --git a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
index c4a3f1e..18ba7b5 100644
--- a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\locale\Unit;
 
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\locale\LocaleTranslation;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -38,9 +41,9 @@ class LocaleTranslationTest extends UnitTestCase {
    */
   protected function setUp() {
     $this->storage = $this->getMock('Drupal\locale\StringStorageInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->requestStack = new RequestStack();
   }
 
diff --git a/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php b/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php
index 0babe2f..cbe970d 100644
--- a/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php
+++ b/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\migrate\Plugin\Derivative;
 
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -56,7 +57,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition)
    */
   public function getDerivativeDefinitions($base_plugin_definition) {
     foreach ($this->entityDefinitions as $entity_type => $entity_info) {
-      $class = is_subclass_of($entity_info->getClass(), 'Drupal\Core\Config\Entity\ConfigEntityInterface') ?
+      $class = is_subclass_of($entity_info->getClass(), ConfigEntityInterface::class) ?
         'Drupal\migrate\Plugin\migrate\destination\EntityConfigBase' :
         'Drupal\migrate\Plugin\migrate\destination\EntityContentBase';
       $this->derivatives[$entity_type] = [
diff --git a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
index 180be0a..5a68cfe 100644
--- a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
+++ b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
@@ -5,6 +5,7 @@
 use Doctrine\Common\Annotations\AnnotationRegistry;
 use Doctrine\Common\Reflection\StaticReflectionParser as BaseStaticReflectionParser;
 use Drupal\Component\Annotation\AnnotationInterface;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Component\Annotation\Reflection\MockFileFinder;
 use Drupal\Component\ClassFinder\ClassFinder;
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
@@ -43,7 +44,7 @@ class AnnotatedClassDiscoveryAutomatedProviders extends AnnotatedClassDiscovery
    * @param string[] $annotation_namespaces
    *   Additional namespaces to scan for annotation definitions.
    */
-  public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) {
+  public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = Plugin::class, array $annotation_namespaces = []) {
     parent::__construct($subdir, $root_namespaces, $plugin_definition_annotation_name, $annotation_namespaces);
     $this->finder = new ClassFinder();
   }
diff --git a/core/modules/migrate/src/Plugin/MigratePluginManager.php b/core/modules/migrate/src/Plugin/MigratePluginManager.php
index b3645db..384d491 100644
--- a/core/modules/migrate/src/Plugin/MigratePluginManager.php
+++ b/core/modules/migrate/src/Plugin/MigratePluginManager.php
@@ -2,9 +2,11 @@
 
 namespace Drupal\migrate\Plugin;
 
+use Drupal\Component\Annotation\PluginID;
 use Drupal\Component\Plugin\Factory\DefaultFactory;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
 
 /**
@@ -40,7 +42,7 @@ class MigratePluginManager extends DefaultPluginManager implements MigratePlugin
    *   (optional) The annotation class name. Defaults to
    *   'Drupal\Component\Annotation\PluginID'.
    */
-  public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, $annotation = 'Drupal\Component\Annotation\PluginID') {
+  public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, $annotation = PluginID::class) {
     parent::__construct("Plugin/migrate/$type", $namespaces, $module_handler, NULL, $annotation);
     $this->alterInfo('migrate_' . $type . '_info');
     $this->setCacheBackend($cache_backend, 'migrate_plugins_' . $type);
@@ -53,7 +55,7 @@ public function createInstance($plugin_id, array $configuration = [], MigrationI
     $plugin_definition = $this->getDefinition($plugin_id);
     $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition);
     // If the plugin provides a factory method, pass the container to it.
-    if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
+    if (is_subclass_of($plugin_class, ContainerFactoryPluginInterface::class)) {
       $plugin = $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition, $migration);
     }
     else {
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
index 00f07a9..69c984e 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
@@ -160,7 +160,7 @@ public function testSource(array $source_data, array $expected_data, $expected_c
     // If an expected count was given, assert it only if the plugin is
     // countable.
     if (is_numeric($expected_count)) {
-      $this->assertInstanceOf('\Countable', $plugin);
+      $this->assertInstanceOf(\Countable::class, $plugin);
       $this->assertCount($expected_count, $plugin);
     }
 
diff --git a/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php b/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
index 576539e..4037361 100644
--- a/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\migrate\Kernel\process;
 
 use Drupal\Core\StreamWrapper\StreamWrapperInterface;
+use Drupal\Core\StreamWrapper\TemporaryStream;
 use Drupal\KernelTests\Core\File\FileTestBase;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Plugin\migrate\process\Download;
@@ -28,7 +29,7 @@ class DownloadTest extends FileTestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->container->get('stream_wrapper_manager')->registerWrapper('temporary', 'Drupal\Core\StreamWrapper\TemporaryStream', StreamWrapperInterface::LOCAL_NORMAL);
+    $this->container->get('stream_wrapper_manager')->registerWrapper('temporary', TemporaryStream::class, StreamWrapperInterface::LOCAL_NORMAL);
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
index 644371e..b6dd21e 100644
--- a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\migrate\Kernel\process;
 
 use Drupal\Core\StreamWrapper\StreamWrapperInterface;
+use Drupal\Core\StreamWrapper\TemporaryStream;
 use Drupal\KernelTests\Core\File\FileTestBase;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Plugin\migrate\process\FileCopy;
@@ -37,7 +38,7 @@ class FileCopyTest extends FileTestBase {
   protected function setUp() {
     parent::setUp();
     $this->fileSystem = $this->container->get('file_system');
-    $this->container->get('stream_wrapper_manager')->registerWrapper('temporary', 'Drupal\Core\StreamWrapper\TemporaryStream', StreamWrapperInterface::LOCAL_NORMAL);
+    $this->container->get('stream_wrapper_manager')->registerWrapper('temporary', TemporaryStream::class, StreamWrapperInterface::LOCAL_NORMAL);
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
index 5e7cbac..bca9dd3 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
@@ -446,7 +446,7 @@ public function testProcessRowPipelineException() {
    *   The mocked migration source.
    */
   protected function getMockSource() {
-    $iterator = $this->getMock('\Iterator');
+    $iterator = $this->getMock(\Iterator::class);
 
     $class = 'Drupal\migrate\Plugin\migrate\source\SourcePluginBase';
     $source = $this->getMockBuilder($class)
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
index 3c3cba8..f4f4fcc 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Schema;
 use Drupal\migrate\Plugin\MigrateIdMapInterface;
 
 /**
@@ -80,7 +82,7 @@ public function testEnsureTablesNotExist() {
         'source' => ['sourceid1', 'sourceid2'],
       ],
     ];
-    $schema = $this->getMockBuilder('Drupal\Core\Database\Schema')
+    $schema = $this->getMockBuilder(Schema::class)
       ->disableOriginalConstructor()
       ->getMock();
     $schema->expects($this->at(0))
@@ -136,7 +138,7 @@ public function testEnsureTablesNotExist() {
    * Tests the ensureTables method when the tables exist.
    */
   public function testEnsureTablesExist() {
-    $schema = $this->getMockBuilder('Drupal\Core\Database\Schema')
+    $schema = $this->getMockBuilder(Schema::class)
       ->disableOriginalConstructor()
       ->getMock();
     $schema->expects($this->at(0))
@@ -198,7 +200,7 @@ public function testEnsureTablesExist() {
    *   it are the actual test and there are no additional asserts added.
    */
   protected function runEnsureTablesTest($schema) {
-    $database = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $database = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
     $database->expects($this->any())
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
index 5f0d550..0acafd4 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
@@ -5,8 +5,11 @@
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
 use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
+use Drupal\Core\State\StateInterface;
 
 /**
  * Base class for Migrate module source unit tests.
@@ -80,9 +83,9 @@
    * {@inheritdoc}
    */
   protected function setUp() {
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $state = $this->getMock('Drupal\Core\State\StateInterface');
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
+    $state = $this->getMock(StateInterface::class);
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
 
     // Mock a key-value store to return high-water values.
     $key_value = $this->getMock(KeyValueStoreInterface::class);
diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
index 19db21a..8b45bdd 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
+use \Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Database\Driver\sqlite\Connection;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\migrate\Plugin\MigrationInterface;
@@ -119,7 +120,7 @@ protected function getDatabase(array $database_contents, $connection_options = [
 
     // Initialize the DIC with a fake module handler for alterable queries.
     $container = new ContainerBuilder();
-    $container->set('module_handler', $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface'));
+    $container->set('module_handler', $this->getMock(ModuleHandlerInterface::class));
     \Drupal::setContainer($container);
 
     // Create the tables and load them up with data, skipping empty ones.
diff --git a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
index 91351cf..488fd89 100644
--- a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\migrate\Plugin\Migration;
 use Drupal\migrate\Plugin\MigrationPluginManager;
 use Drupal\Tests\UnitTestCase;
@@ -26,9 +29,9 @@ public function setUp() {
     parent::setUp();
 
     // Get a plugin manager for testing.
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
+    $cache_backend = $this->getMock(CacheBackendInterface::class);
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
     $this->pluginManager = new MigrationPluginManager($module_handler, $cache_backend, $language_manager);
   }
 
diff --git a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
index b8097a3..21c66bc 100644
--- a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
+use Drupal\Core\Database\Connection;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\Plugin\migrate\source\SqlBase;
 use Drupal\Tests\UnitTestCase;
@@ -38,7 +39,7 @@ class SqlBaseTest extends UnitTestCase {
    */
   public function testMapJoinable($expected_result, $id_map_is_sql, $with_id_map, $source_options = [], $idmap_options = []) {
     // Setup a connection object.
-    $source_connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $source_connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
     $source_connection->expects($id_map_is_sql && $with_id_map ? $this->once() : $this->never())
@@ -46,7 +47,7 @@ public function testMapJoinable($expected_result, $id_map_is_sql, $with_id_map,
       ->willReturn($source_options);
 
     // Setup the ID map connection.
-    $idmap_connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $idmap_connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
     $idmap_connection->expects($id_map_is_sql && $with_id_map ? $this->once() : $this->never())
diff --git a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
index b57cffe..7eb85c8 100644
--- a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit\destination;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\Plugin\migrate\destination\Config;
 use Drupal\Tests\UnitTestCase;
@@ -22,7 +23,7 @@ public function testImport() {
     $migration = $this->getMockBuilder('Drupal\migrate\Plugin\Migration')
       ->disableOriginalConstructor()
       ->getMock();
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(\Drupal\Core\Config\Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     foreach ($source as $key => $val) {
@@ -36,7 +37,7 @@ public function testImport() {
     $config->expects($this->once())
       ->method('getName')
       ->willReturn('d8_config');
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->once())
       ->method('getEditable')
       ->with('d8_config')
@@ -69,7 +70,7 @@ public function testLanguageImport() {
     $migration = $this->getMockBuilder(MigrationInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(\Drupal\Core\Config\Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     foreach ($source as $key => $val) {
@@ -83,7 +84,7 @@ public function testLanguageImport() {
     $config->expects($this->any())
       ->method('getName')
       ->willReturn('d8_config');
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->once())
       ->method('getEditable')
       ->with('d8_config')
diff --git a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
index f68c2be..101085a 100644
--- a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
@@ -7,6 +7,11 @@
 
 namespace Drupal\Tests\migrate\Unit\destination;
 
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityStorageInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Entity\RevisionableInterface;
+use \Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\migrate\Plugin\MigrationInterface;
@@ -47,9 +52,9 @@ protected function setUp() {
 
     // Setup mocks to be used when creating a revision destination.
     $this->migration = $this->prophesize(MigrationInterface::class);
-    $this->storage = $this->prophesize('\Drupal\Core\Entity\EntityStorageInterface');
-    $this->entityManager = $this->prophesize('\Drupal\Core\Entity\EntityManagerInterface');
-    $this->fieldTypeManager = $this->prophesize('\Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $this->storage = $this->prophesize(EntityStorageInterface::class);
+    $this->entityManager = $this->prophesize(EntityManagerInterface::class);
+    $this->fieldTypeManager = $this->prophesize(FieldTypePluginManagerInterface::class);
   }
 
   /**
@@ -60,8 +65,8 @@ protected function setUp() {
   public function testGetEntityDestinationValues() {
     $destination = $this->getEntityRevisionDestination([]);
     // Return a dummy because we don't care what gets called.
-    $entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
-      ->willImplement('\Drupal\Core\Entity\RevisionableInterface');
+    $entity = $this->prophesize(\Drupal\Core\Entity\EntityInterface::class)
+      ->willImplement(RevisionableInterface::class);
     // Assert that the first ID from the destination values is used to load the
     // entity.
     $this->storage->loadRevision(12)
@@ -78,10 +83,10 @@ public function testGetEntityDestinationValues() {
    */
   public function testGetEntityUpdateRevision() {
     $destination = $this->getEntityRevisionDestination([]);
-    $entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
-      ->willImplement('\Drupal\Core\Entity\RevisionableInterface');
+    $entity = $this->prophesize(\Drupal\Core\Entity\EntityInterface::class)
+      ->willImplement(RevisionableInterface::class);
 
-    $entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->prophesize(EntityTypeInterface::class);
     $entity_type->getKey('id')->willReturn('nid');
     $entity_type->getKey('revision')->willReturn('vid');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
@@ -106,10 +111,10 @@ public function testGetEntityUpdateRevision() {
    */
   public function testGetEntityNewRevision() {
     $destination = $this->getEntityRevisionDestination([]);
-    $entity = $this->prophesize('\Drupal\Core\Entity\EntityInterface')
-      ->willImplement('\Drupal\Core\Entity\RevisionableInterface');
+    $entity = $this->prophesize(\Drupal\Core\Entity\EntityInterface::class)
+      ->willImplement(RevisionableInterface::class);
 
-    $entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->prophesize(EntityTypeInterface::class);
     $entity_type->getKey('id')->willReturn('nid');
     $entity_type->getKey('revision')->willReturn('vid');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
@@ -138,7 +143,7 @@ public function testGetEntityNewRevision() {
   public function testGetEntityLoadFailure() {
     $destination = $this->getEntityRevisionDestination([]);
 
-    $entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->prophesize(EntityTypeInterface::class);
     $entity_type->getKey('id')->willReturn('nid');
     $entity_type->getKey('revision')->willReturn('vid');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
@@ -159,7 +164,7 @@ public function testGetEntityLoadFailure() {
    * @covers ::save
    */
   public function testSave() {
-    $entity = $this->prophesize('\Drupal\Core\Entity\ContentEntityInterface');
+    $entity = $this->prophesize(\Drupal\Core\Entity\ContentEntityInterface::class);
     $entity->save()
       ->shouldBeCalled();
     $entity->getRevisionId()
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
index 6deaec8..6b0f0f1 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\migrate\Unit\destination;
 
+use Drupal\Core\Entity\Entity\EntityViewDisplay;
 use Drupal\migrate\Plugin\migrate\destination\ComponentEntityDisplayBase;
 use Drupal\migrate\Row;
 use Drupal\Tests\migrate\Unit\MigrateTestCase;
@@ -33,7 +34,7 @@ public function testImport() {
     foreach ($values as $key => $value) {
       $row->setDestinationProperty($key, $value);
     }
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\Entity\EntityViewDisplay')
+    $entity = $this->getMockBuilder(EntityViewDisplay::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity->expects($this->once())
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
index 0424ceb..7e904d4 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\migrate\Unit\destination;
 
+use Drupal\Core\Entity\Entity\EntityFormDisplay;
 use Drupal\migrate\Plugin\migrate\destination\PerComponentEntityFormDisplay;
 use Drupal\migrate\Row;
 use Drupal\Tests\migrate\Unit\MigrateTestCase;
@@ -33,7 +34,7 @@ public function testImport() {
     foreach ($values as $key => $value) {
       $row->setDestinationProperty($key, $value);
     }
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\Entity\EntityFormDisplay')
+    $entity = $this->getMockBuilder(EntityFormDisplay::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity->expects($this->once())
diff --git a/core/modules/migrate/tests/src/Unit/process/CallbackTest.php b/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
index e3b8f27..7cc8479 100644
--- a/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\migrate\Unit\process;
 
+use \Drupal\Component\Utility\Unicode;
 use Drupal\migrate\Plugin\migrate\process\Callback;
 
 /**
@@ -37,7 +38,7 @@ public function testCallbackWithFunction() {
    * Test callback with a class method as callable.
    */
   public function testCallbackWithClassMethod() {
-    $this->plugin->setCallable(['\Drupal\Component\Utility\Unicode', 'strtolower']);
+    $this->plugin->setCallable([Unicode::class, 'strtolower']);
     $value = $this->plugin->transform('FooBar', $this->migrateExecutable, $this->row, 'destinationproperty');
     $this->assertSame($value, 'foobar');
   }
diff --git a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
index 3775334..f5050eb 100644
--- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
@@ -43,7 +43,7 @@ class DedupeEntityTest extends MigrateProcessTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityQuery = $this->getMockBuilder('Drupal\Core\Entity\Query\QueryInterface')
+    $this->entityQuery = $this->getMockBuilder(QueryInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class);
diff --git a/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php b/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
index 5bc9158..60e5676 100644
--- a/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit\process;
 
+use Drupal\Component\Transliteration\TransliterationInterface;
 use Drupal\migrate\Plugin\migrate\process\MachineName;
 
 /**
@@ -22,7 +23,7 @@ class MachineNameTest extends MigrateProcessTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->transliteration = $this->getMockBuilder('Drupal\Component\Transliteration\TransliterationInterface')
+    $this->transliteration = $this->getMockBuilder(TransliterationInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->row = $this->getMockBuilder('Drupal\migrate\Row')
diff --git a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
index 2f33e62..ab5c62e 100644
--- a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
@@ -42,7 +42,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityQuery = $this->getMockBuilder('Drupal\Core\Entity\Query\QueryInterface')
+    $this->entityQuery = $this->getMockBuilder(QueryInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class);
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
index 6dd5925..23d319c 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\migrate_drupal\Unit\source;
 
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\migrate\Unit\MigrateTestCase;
 use Drupal\migrate\Exception\RequirementsException;
 
@@ -45,9 +47,9 @@ public function testSourceProviderNotActive() {
     $plugin_definition['requirements_met'] = TRUE;
     $plugin_definition['source_provider'] = 'module1';
     /** @var \Drupal\Core\State\StateInterface $state */
-    $state = $this->getMock('Drupal\Core\State\StateInterface');
+    $state = $this->getMock(StateInterface::class);
     /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $plugin = new TestDrupalSqlBase([], 'placeholder_id', $plugin_definition, $this->getMigration(), $state, $entity_manager);
     $plugin->setDatabase($this->getDatabase($this->databaseContents));
     $system_data = $plugin->getSystemData();
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
index 55d1282..0a9f33c 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Tests\migrate_drupal\Unit\source\d6;
 
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\migrate\Unit\MigrateTestCase;
 
 /**
@@ -69,9 +71,9 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
   protected function setUp() {
     $plugin = 'placeholder_id';
     /** @var \Drupal\Core\State\StateInterface $state */
-    $state = $this->getMock('Drupal\Core\State\StateInterface');
+    $state = $this->getMock(StateInterface::class);
     /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, [], $this->getMigration(), $state, $entity_manager);
     $this->base->setDatabase($this->getDatabase($this->databaseContents));
   }
diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php
index 6d7c8eb..c6d0d05 100644
--- a/core/modules/node/src/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/src/Plugin/Search/NodeSearch.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\node\Plugin\Search;
 
+use \Drupal\Component\Utility\Html;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\Config\Config;
@@ -16,6 +17,7 @@
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessibleInterface;
 use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\node\NodeInterface;
 use Drupal\search\Plugin\ConfigurableSearchPluginBase;
@@ -227,7 +229,7 @@ protected function findResults() {
     $query = $this->database
       ->select('search_index', 'i', ['target' => 'replica'])
       ->extend('Drupal\search\SearchQuery')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
+      ->extend(PagerSelectExtender::class);
     $query->join('node_field_data', 'n', 'n.nid = i.sid AND n.langcode = i.langcode');
     $query->condition('n.status', 1)
       ->addTag('node_access')
@@ -578,7 +580,7 @@ public function searchFormAlter(array &$form, FormStateInterface $form_state) {
     ];
 
     // Add node types.
-    $types = array_map(['\Drupal\Component\Utility\Html', 'escape'], node_type_get_names());
+    $types = array_map([Html::class, 'escape'], node_type_get_names());
     $form['advanced']['types-fieldset'] = [
       '#type' => 'fieldset',
       '#title' => t('Types'),
diff --git a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
index 42ab01d..ceb26cd 100644
--- a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
+++ b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\node\Unit\PageCache;
 
 use Drupal\Core\PageCache\ResponsePolicyInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\node\PageCache\DenyNodePreview;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -43,7 +44,7 @@ class DenyNodePreviewTest extends UnitTestCase {
   protected $routeMatch;
 
   protected function setUp() {
-    $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $this->routeMatch = $this->getMock(RouteMatchInterface::class);
     $this->policy = new DenyNodePreview($this->routeMatch);
     $this->response = new Response();
     $this->request = new Request();
diff --git a/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php b/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
index eb92f8c..9d5e7dc 100644
--- a/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
+++ b/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
@@ -3,6 +3,9 @@
 namespace Drupal\Tests\node\Unit\Plugin\views\field;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\node\Plugin\views\field\NodeBulkForm;
 use Drupal\Tests\UnitTestCase;
 
@@ -41,18 +44,18 @@ public function testConstructor() {
       ->will($this->returnValue('user'));
     $actions[] = $action;
 
-    $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_storage = $this->getMock(EntityStorageInterface::class);
     $entity_storage->expects($this->any())
       ->method('loadMultiple')
       ->will($this->returnValue($actions));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->once())
       ->method('getStorage')
       ->with('action')
       ->will($this->returnValue($entity_storage));
 
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
 
     $views_data = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
diff --git a/core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php b/core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php
index 0827436..e7fa1d9 100644
--- a/core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php
+++ b/core/modules/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php
@@ -8,6 +8,7 @@
 use Drupal\quickedit\Access\QuickEditEntityFieldAccessCheck;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Session\AccountInterface;
 
 /**
  * @coversDefaultClass \Drupal\quickedit\Access\QuickEditEntityFieldAccessCheck
@@ -88,7 +89,7 @@ public function testAccess($entity_is_editable, $field_storage_is_accessible, Ac
       ->with(LanguageInterface::LANGCODE_NOT_SPECIFIED)
       ->will($this->returnValue(TRUE));
 
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $access = $this->editAccessCheck->access($entity_with_field, $field_name, LanguageInterface::LANGCODE_NOT_SPECIFIED, $account);
     $this->assertEquals($expected_result, $access);
   }
@@ -99,7 +100,7 @@ public function testAccess($entity_is_editable, $field_storage_is_accessible, Ac
    * @dataProvider providerTestAccessForbidden
    */
   public function testAccessForbidden($field_name, $langcode) {
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $entity = $this->createMockEntity();
     $this->assertEquals(AccessResult::forbidden(), $this->editAccessCheck->access($entity, $field_name, $langcode, $account));
   }
diff --git a/core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php b/core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php
index 5908ee7..8e710e3 100644
--- a/core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php
+++ b/core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\rdf\Unit;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 use Drupal\rdf\Entity\RdfMapping;
@@ -46,14 +49,14 @@ class RdfMappingConfigEntityUnitTest extends UnitTestCase {
   protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('entity'));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -68,7 +71,7 @@ protected function setUp() {
   public function testCalculateDependencies() {
     $target_entity_type_id = $this->randomMachineName(16);
 
-    $target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $target_entity_type = $this->getMock(EntityTypeInterface::class);
     $target_entity_type->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('test_module'));
@@ -97,7 +100,7 @@ public function testCalculateDependencies() {
    */
   public function testCalculateDependenciesWithEntityBundle() {
     $target_entity_type_id = $this->randomMachineName(16);
-    $target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $target_entity_type = $this->getMock(EntityTypeInterface::class);
     $target_entity_type->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('test_module'));
diff --git a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
index bc9663d..7820da0 100644
--- a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
+++ b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\responsive_image\Unit;
 
+use \Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\responsive_image\Entity\ResponsiveImageStyle;
 use Drupal\Tests\UnitTestCase;
@@ -37,12 +41,12 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('responsive_image'));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with('responsive_image_style')
@@ -63,13 +67,13 @@ public function testCalculateDependencies() {
     // Set up image style loading mock.
     $styles = [];
     foreach (['fallback', 'small', 'medium', 'large'] as $style) {
-      $mock = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
+      $mock = $this->getMock(ConfigEntityInterface::class);
       $mock->expects($this->any())
         ->method('getConfigDependencyName')
         ->willReturn('image.style.' . $style);
       $styles[$style] = $mock;
     }
-    $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
+    $storage = $this->getMock(ConfigEntityStorageInterface::class);
     $storage->expects($this->any())
       ->method('loadMultiple')
       ->with(array_keys($styles))
diff --git a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
index 3b1c1f7..a7c53c2 100644
--- a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
+++ b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
@@ -2,8 +2,13 @@
 
 namespace Drupal\Tests\rest\Unit;
 
+use \Drupal\Core\Authentication\AuthenticationCollectorInterface;
+use \Drupal\Core\Routing\RouteProviderInterface;
+use \Drupal\Core\State\StateInterface;
+use \Symfony\Component\HttpFoundation\Request;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Render\RendererInterface;
 use Drupal\rest\Plugin\views\display\RestExport;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
@@ -35,7 +40,7 @@ protected function setUp() {
 
     $container = new ContainerBuilder();
 
-    $request = $this->getMockBuilder('\Symfony\Component\HttpFoundation\Request')
+    $request = $this->getMockBuilder(Request::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -62,23 +67,23 @@ protected function setUp() {
       ->getMock();
     $container->set('plugin.manager.views.access', $access_manager);
 
-    $route_provider = $this->getMockBuilder('\Drupal\Core\Routing\RouteProviderInterface')
+    $route_provider = $this->getMockBuilder(RouteProviderInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $container->set('router.route_provider', $route_provider);
 
     $container->setParameter('authentication_providers', ['basic_auth' => 'basic_auth']);
 
-    $state = $this->getMock('\Drupal\Core\State\StateInterface');
+    $state = $this->getMock(StateInterface::class);
     $container->set('state', $state);
 
     $style_manager = $this->getMockBuilder('\Drupal\views\Plugin\ViewsPluginManager')
       ->disableOriginalConstructor()
       ->getMock();
     $container->set('plugin.manager.views.style', $style_manager);
-    $container->set('renderer', $this->getMock('Drupal\Core\Render\RendererInterface'));
+    $container->set('renderer', $this->getMock(RendererInterface::class));
 
-    $authentication_collector = $this->getMock('\Drupal\Core\Authentication\AuthenticationCollectorInterface');
+    $authentication_collector = $this->getMock(AuthenticationCollectorInterface::class);
     $container->set('authentication_collector', $authentication_collector);
     $authentication_collector->expects($this->any())
       ->method('getSortedProviders')
diff --git a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
index 69dffd8..1f71157 100644
--- a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
+++ b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
@@ -7,6 +7,12 @@
 
 namespace Drupal\Tests\search\Unit;
 
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\search\Entity\SearchPage;
 use Drupal\search\SearchPageRepository;
 use Drupal\Tests\UnitTestCase;
@@ -49,19 +55,19 @@ class SearchPageRepositoryTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $this->query = $this->getMock(QueryInterface::class);
 
-    $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
+    $this->storage = $this->getMock(ConfigEntityStorageInterface::class);
     $this->storage->expects($this->any())
       ->method('getQuery')
       ->will($this->returnValue($this->query));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->any())
       ->method('getStorage')
       ->will($this->returnValue($this->storage));
 
-    $this->configFactory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $this->configFactory = $this->getMock(ConfigFactoryInterface::class);
     $this->searchPageRepository = new SearchPageRepository($this->configFactory, $entity_manager);
   }
 
@@ -143,7 +149,7 @@ public function testGetIndexableSearchPages() {
    * Tests the clearDefaultSearchPage() method.
    */
   public function testClearDefaultSearchPage() {
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->once())
@@ -169,7 +175,7 @@ public function testGetDefaultSearchPageWithActiveDefault() {
       ->method('execute')
       ->will($this->returnValue(['test' => 'test', 'other_test' => 'other_test']));
 
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->once())
@@ -196,7 +202,7 @@ public function testGetDefaultSearchPageWithInactiveDefault() {
       ->method('execute')
       ->will($this->returnValue(['test' => 'test']));
 
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->once())
@@ -216,7 +222,7 @@ public function testGetDefaultSearchPageWithInactiveDefault() {
    */
   public function testSetDefaultSearchPage() {
     $id = 'bananas';
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->once())
@@ -248,7 +254,7 @@ public function testSetDefaultSearchPage() {
    * Tests the sortSearchPages() method.
    */
   public function testSortSearchPages() {
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->any())
       ->method('getClass')
       ->will($this->returnValue('Drupal\Tests\search\Unit\TestSearchPage'));
diff --git a/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php b/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
index 25ab873..87ae656 100644
--- a/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
+++ b/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\search\Unit;
 
+use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\search\Plugin\SearchPluginCollection;
 use Drupal\Tests\UnitTestCase;
 
@@ -36,7 +37,7 @@ class SearchPluginCollectionTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->pluginManager = $this->getMock('Drupal\Component\Plugin\PluginManagerInterface');
+    $this->pluginManager = $this->getMock(PluginManagerInterface::class);
     $this->searchPluginCollection = new SearchPluginCollection($this->pluginManager, 'banana', ['id' => 'banana', 'color' => 'yellow'], 'fruit_stand');
   }
 
diff --git a/core/modules/serialization/src/Normalizer/ComplexDataNormalizer.php b/core/modules/serialization/src/Normalizer/ComplexDataNormalizer.php
index 3d20312..faaf12f 100644
--- a/core/modules/serialization/src/Normalizer/ComplexDataNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/ComplexDataNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Core\TypedData\ComplexDataInterface;
+
 /**
  * Converts the Drupal entity object structures to a normalized array.
  *
@@ -19,7 +21,7 @@ class ComplexDataNormalizer extends NormalizerBase {
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ComplexDataInterface';
+  protected $supportedInterfaceOrClass = ComplexDataInterface::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php b/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php
index 344bcc3..832f477 100644
--- a/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
+
 /**
  * Normalizes/denormalizes Drupal config entity objects into an array structure.
  */
@@ -12,7 +14,7 @@ class ConfigEntityNormalizer extends EntityNormalizer {
    *
    * @var array
    */
-  protected $supportedInterfaceOrClass = ['Drupal\Core\Config\Entity\ConfigEntityInterface'];
+  protected $supportedInterfaceOrClass = [ConfigEntityInterface::class];
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/src/Normalizer/ContentEntityNormalizer.php b/core/modules/serialization/src/Normalizer/ContentEntityNormalizer.php
index f1ca82d..7454a7c 100644
--- a/core/modules/serialization/src/Normalizer/ContentEntityNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/ContentEntityNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Core\Entity\ContentEntityInterface;
+
 /**
  * Normalizes/denormalizes Drupal content entities into an array structure.
  */
@@ -10,7 +12,7 @@ class ContentEntityNormalizer extends EntityNormalizer {
   /**
    * {@inheritdoc}
    */
-  protected $supportedInterfaceOrClass = ['Drupal\Core\Entity\ContentEntityInterface'];
+  protected $supportedInterfaceOrClass = [ContentEntityInterface::class];
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/src/Normalizer/ListNormalizer.php b/core/modules/serialization/src/Normalizer/ListNormalizer.php
index 471886e..af4ee68 100644
--- a/core/modules/serialization/src/Normalizer/ListNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/ListNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Core\TypedData\ListInterface;
+
 /**
  * Converts list objects to arrays.
  *
@@ -18,7 +20,7 @@ class ListNormalizer extends NormalizerBase {
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\ListInterface';
+  protected $supportedInterfaceOrClass = ListInterface::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/src/Normalizer/MarkupNormalizer.php b/core/modules/serialization/src/Normalizer/MarkupNormalizer.php
index f4c197b..6649d0e 100644
--- a/core/modules/serialization/src/Normalizer/MarkupNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/MarkupNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Component\Render\MarkupInterface;
+
 /**
  * Normalizes MarkupInterface objects into a string.
  */
@@ -12,7 +14,7 @@ class MarkupNormalizer extends NormalizerBase {
    *
    * @var array
    */
-  protected $supportedInterfaceOrClass = ['Drupal\Component\Render\MarkupInterface'];
+  protected $supportedInterfaceOrClass = [MarkupInterface::class];
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/src/Normalizer/TypedDataNormalizer.php b/core/modules/serialization/src/Normalizer/TypedDataNormalizer.php
index 60ce7d0..77b3148 100644
--- a/core/modules/serialization/src/Normalizer/TypedDataNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/TypedDataNormalizer.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\serialization\Normalizer;
 
+use Drupal\Core\TypedData\TypedDataInterface;
+
 /**
  * Converts typed data objects to arrays.
  */
@@ -12,7 +14,7 @@ class TypedDataNormalizer extends NormalizerBase {
    *
    * @var string
    */
-  protected $supportedInterfaceOrClass = 'Drupal\Core\TypedData\TypedDataInterface';
+  protected $supportedInterfaceOrClass = TypedDataInterface::class;
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php b/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
index 8123925..4c9c9b7 100644
--- a/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
+++ b/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\serialization\Unit\EntityResolver;
 
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManager;
 use Drupal\Tests\UnitTestCase;
 use Drupal\serialization\EntityResolver\UuidResolver;
 
@@ -29,7 +31,7 @@ class UuidResolverTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+    $this->entityManager = $this->getMockBuilder(EntityManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -88,7 +90,7 @@ public function testResolveNoEntity() {
   public function testResolveWithEntity() {
     $uuid = '392eab92-35c2-4625-872d-a9dab4da008e';
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->once())
       ->method('id')
       ->will($this->returnValue(1));
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
index 371450a..6076e4d 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\serialization\Normalizer\ConfigEntityNormalizer;
 use Drupal\Tests\UnitTestCase;
 
@@ -19,10 +21,10 @@ class ConfigEntityNormalizerTest extends UnitTestCase {
   public function testNormalize() {
     $test_export_properties = ['test' => 'test'];
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $normalizer = new ConfigEntityNormalizer($entity_manager);
 
-    $config_entity = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $config_entity = $this->getMock(ConfigEntityInterface::class);
     $config_entity->expects($this->once())
       ->method('toArray')
       ->will($this->returnValue($test_export_properties));
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
index 4beecf4..edbf8c7 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
@@ -2,6 +2,11 @@
 
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\serialization\Normalizer\ContentEntityNormalizer;
 use Drupal\Tests\UnitTestCase;
 
@@ -36,7 +41,7 @@ class ContentEntityNormalizerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->contentEntityNormalizer = new ContentEntityNormalizer($this->entityManager);
     $this->serializer = $this->getMockBuilder('Symfony\Component\Serializer\Serializer')
       ->disableOriginalConstructor()
@@ -49,7 +54,7 @@ protected function setUp() {
    * @covers ::supportsNormalization
    */
   public function testSupportsNormalization() {
-    $content_mock = $this->getMock('Drupal\Core\Entity\ContentEntityInterface');
+    $content_mock = $this->getMock(ContentEntityInterface::class);
     $config_mock = $this->getMock('Drupal\Core\Entity\ConfigEntityInterface');
     $this->assertTrue($this->contentEntityNormalizer->supportsNormalization($content_mock));
     $this->assertFalse($this->contentEntityNormalizer->supportsNormalization($config_mock));
@@ -63,7 +68,7 @@ public function testSupportsNormalization() {
   public function testNormalize() {
     $this->serializer->expects($this->any())
       ->method('normalize')
-      ->with($this->containsOnlyInstancesOf('Drupal\Core\Field\FieldItemListInterface'), 'test_format', ['account' => NULL])
+      ->with($this->containsOnlyInstancesOf(FieldItemListInterface::class), 'test_format', ['account' => NULL])
       ->will($this->returnValue('test'));
 
     $definitions = [
@@ -85,7 +90,7 @@ public function testNormalize() {
    * @covers ::normalize
    */
   public function testNormalizeWithAccountContext() {
-    $mock_account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $mock_account = $this->getMock(AccountInterface::class);
 
     $context = [
       'account' => $mock_account,
@@ -93,7 +98,7 @@ public function testNormalizeWithAccountContext() {
 
     $this->serializer->expects($this->any())
       ->method('normalize')
-      ->with($this->containsOnlyInstancesOf('Drupal\Core\Field\FieldItemListInterface'), 'test_format', $context)
+      ->with($this->containsOnlyInstancesOf(FieldItemListInterface::class), 'test_format', $context)
       ->will($this->returnValue('test'));
 
     // The mock account should get passed directly into the access() method on
@@ -119,7 +124,7 @@ public function testNormalizeWithAccountContext() {
    * @return \PHPUnit_Framework_MockObject_MockObject
    */
   public function createMockForContentEntity($definitions) {
-    $content_entity_mock = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $content_entity_mock = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->setMethods(['getFields'])
       ->getMockForAbstractClass();
@@ -138,7 +143,7 @@ public function createMockForContentEntity($definitions) {
    * @return \Drupal\Core\Field\FieldItemListInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function createMockFieldListItem($access = TRUE, $user_context = NULL) {
-    $mock = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $mock = $this->getMock(FieldItemListInterface::class);
     $mock->expects($this->once())
       ->method('access')
       ->with('view', $user_context)
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
index 689d654..9a2dba1 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
@@ -2,8 +2,17 @@
 
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\serialization\Normalizer\EntityNormalizer;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Serializer\Exception\UnexpectedValueException;
@@ -39,7 +48,7 @@ class EntityNormalizerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityNormalizer = new EntityNormalizer($this->entityManager);
   }
 
@@ -49,15 +58,15 @@ protected function setUp() {
    * @covers ::normalize
    */
   public function testNormalize() {
-    $list_item_1 = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
-    $list_item_2 = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $list_item_1 = $this->getMock(TypedDataInterface::class);
+    $list_item_2 = $this->getMock(TypedDataInterface::class);
 
     $definitions = [
       'field_1' => $list_item_1,
       'field_2' => $list_item_2,
     ];
 
-    $content_entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $content_entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->setMethods(['getFields'])
       ->getMockForAbstractClass();
@@ -88,7 +97,7 @@ public function testNormalize() {
    */
   public function testDenormalizeWithNoEntityType() {
     $this->setExpectedException(UnexpectedValueException::class);
-    $this->entityNormalizer->denormalize([], 'Drupal\Core\Entity\ContentEntityBase');
+    $this->entityNormalizer->denormalize([], ContentEntityBase::class);
   }
 
   /**
@@ -105,7 +114,7 @@ public function testDenormalizeWithValidBundle() {
       ],
     ];
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
 
     $entity_type->expects($this->once())
       ->method('id')
@@ -127,12 +136,12 @@ public function testDenormalizeWithValidBundle() {
       ->method('getBundleEntityType')
       ->will($this->returnValue('test_bundle'));
 
-    $entity_type_storage_definition = $this->getmock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $entity_type_storage_definition = $this->getmock(FieldStorageDefinitionInterface::class);
     $entity_type_storage_definition->expects($this->once())
       ->method('getMainPropertyName')
       ->will($this->returnValue('name'));
 
-    $entity_type_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $entity_type_definition = $this->getMock(FieldDefinitionInterface::class);
     $entity_type_definition->expects($this->once())
       ->method('getFieldStorageDefinition')
       ->will($this->returnValue($entity_type_storage_definition));
@@ -150,12 +159,12 @@ public function testDenormalizeWithValidBundle() {
       ->with('test')
       ->will($this->returnValue($base_definitions));
 
-    $entity_query_mock = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $entity_query_mock = $this->getMock(QueryInterface::class);
     $entity_query_mock->expects($this->once())
       ->method('execute')
       ->will($this->returnValue(['test_bundle' => 'test_bundle']));
 
-    $entity_type_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_type_storage = $this->getMock(EntityStorageInterface::class);
     $entity_type_storage->expects($this->once())
       ->method('getQuery')
       ->will($this->returnValue($entity_query_mock));
@@ -178,7 +187,7 @@ public function testDenormalizeWithValidBundle() {
       ->with('key_2')
       ->willReturn($key_2);
 
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     // Create should only be called with the bundle property at first.
     $expected_test_data = [
       'test_type' => 'test_bundle',
@@ -209,7 +218,7 @@ public function testDenormalizeWithValidBundle() {
 
     $this->entityNormalizer->setSerializer($serializer);
 
-    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']));
+    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, ContentEntityBase::class, NULL, ['entity_type' => 'test']));
   }
 
   /**
@@ -226,7 +235,7 @@ public function testDenormalizeWithInvalidBundle() {
       ],
     ];
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
 
     $entity_type->expects($this->once())
       ->method('id')
@@ -248,12 +257,12 @@ public function testDenormalizeWithInvalidBundle() {
       ->method('getBundleEntityType')
       ->will($this->returnValue('test_bundle'));
 
-    $entity_type_storage_definition = $this->getmock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $entity_type_storage_definition = $this->getmock(FieldStorageDefinitionInterface::class);
     $entity_type_storage_definition->expects($this->once())
       ->method('getMainPropertyName')
       ->will($this->returnValue('name'));
 
-    $entity_type_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $entity_type_definition = $this->getMock(FieldDefinitionInterface::class);
     $entity_type_definition->expects($this->once())
       ->method('getFieldStorageDefinition')
       ->will($this->returnValue($entity_type_storage_definition));
@@ -271,12 +280,12 @@ public function testDenormalizeWithInvalidBundle() {
       ->with('test')
       ->will($this->returnValue($base_definitions));
 
-    $entity_query_mock = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $entity_query_mock = $this->getMock(QueryInterface::class);
     $entity_query_mock->expects($this->once())
       ->method('execute')
       ->will($this->returnValue(['test_bundle_other' => 'test_bundle_other']));
 
-    $entity_type_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_type_storage = $this->getMock(EntityStorageInterface::class);
     $entity_type_storage->expects($this->once())
       ->method('getQuery')
       ->will($this->returnValue($entity_query_mock));
@@ -287,7 +296,7 @@ public function testDenormalizeWithInvalidBundle() {
       ->will($this->returnValue($entity_type_storage));
 
     $this->setExpectedException(UnexpectedValueException::class);
-    $this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']);
+    $this->entityNormalizer->denormalize($test_data, ContentEntityBase::class, NULL, ['entity_type' => 'test']);
   }
 
   /**
@@ -301,7 +310,7 @@ public function testDenormalizeWithNoBundle() {
       'key_2' => 'value_2',
     ];
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('isSubClassOf')
       ->with(FieldableEntityInterface::class)
@@ -331,7 +340,7 @@ public function testDenormalizeWithNoBundle() {
       ->with('key_2')
       ->willReturn($key_2);
 
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('create')
       ->with([])
@@ -360,7 +369,7 @@ public function testDenormalizeWithNoBundle() {
 
     $this->entityNormalizer->setSerializer($serializer);
 
-    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']));
+    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, ContentEntityBase::class, NULL, ['entity_type' => 'test']));
   }
 
   /**
@@ -374,7 +383,7 @@ public function testDenormalizeWithNoFieldableEntityType() {
       'key_2' => 'value_2',
     ];
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('isSubClassOf')
       ->with(FieldableEntityInterface::class)
@@ -388,11 +397,11 @@ public function testDenormalizeWithNoFieldableEntityType() {
       ->with('test')
       ->will($this->returnValue($entity_type));
 
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('create')
       ->with($test_data)
-      ->will($this->returnValue($this->getMock('Drupal\Core\Entity\EntityInterface')));
+      ->will($this->returnValue($this->getMock(EntityInterface::class)));
 
     $this->entityManager->expects($this->once())
       ->method('getStorage')
@@ -402,7 +411,7 @@ public function testDenormalizeWithNoFieldableEntityType() {
     $this->entityManager->expects($this->never())
       ->method('getBaseFieldDefinitions');
 
-    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']));
+    $this->assertNotNull($this->entityNormalizer->denormalize($test_data, ContentEntityBase::class, NULL, ['entity_type' => 'test']));
   }
 
 }
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
index fccc6db..a098a8a 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
 use Drupal\Core\TypedData\DataDefinition;
+use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\serialization\Normalizer\ListNormalizer;
@@ -45,7 +46,7 @@ class ListNormalizerTest extends UnitTestCase {
 
   protected function setUp() {
     // Mock the TypedDataManager to return a TypedDataInterface mock.
-    $this->typedData = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $this->typedData = $this->getMock(TypedDataInterface::class);
     $typed_data_manager = $this->getMock(TypedDataManagerInterface::class);
     $typed_data_manager->expects($this->any())
       ->method('getPropertyInstance')
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
index 34a28b2..0f77da8 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
+use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\serialization\Normalizer\NullNormalizer;
 use Drupal\Tests\UnitTestCase;
 
@@ -23,7 +24,7 @@ class NullNormalizerTest extends UnitTestCase {
    *
    * @var string
    */
-  protected $interface = 'Drupal\Core\TypedData\TypedDataInterface';
+  protected $interface = TypedDataInterface::class;
 
   /**
    * {@inheritdoc}
@@ -37,7 +38,7 @@ protected function setUp() {
    * @covers ::supportsNormalization
    */
   public function testSupportsNormalization() {
-    $mock = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $mock = $this->getMock(TypedDataInterface::class);
     $this->assertTrue($this->normalizer->supportsNormalization($mock));
     // Also test that an object not implementing TypedDataInterface fails.
     $this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
@@ -47,7 +48,7 @@ public function testSupportsNormalization() {
    * @covers ::normalize
    */
   public function testNormalize() {
-    $mock = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $mock = $this->getMock(TypedDataInterface::class);
     $this->assertNull($this->normalizer->normalize($mock));
   }
 
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
index 6a31e2e..477a7c8 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\serialization\Unit\Normalizer;
 
+use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\serialization\Normalizer\TypedDataNormalizer;
 
@@ -27,7 +28,7 @@ class TypedDataNormalizerTest extends UnitTestCase {
 
   protected function setUp() {
     $this->normalizer = new TypedDataNormalizer();
-    $this->typedData = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $this->typedData = $this->getMock(TypedDataInterface::class);
   }
 
   /**
diff --git a/core/modules/simpletest/src/InstallerTestBase.php b/core/modules/simpletest/src/InstallerTestBase.php
index 92f33dc..c3154fc 100644
--- a/core/modules/simpletest/src/InstallerTestBase.php
+++ b/core/modules/simpletest/src/InstallerTestBase.php
@@ -4,8 +4,10 @@
 
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageDefault;
 use Drupal\Core\Session\UserSession;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\StringTranslation\TranslationManager;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\HttpFoundation\Request;
@@ -105,10 +107,10 @@ protected function setUp() {
     $this->container
       ->setParameter('language.default_values', Language::$defaultValues);
     $this->container
-      ->register('language.default', 'Drupal\Core\Language\LanguageDefault')
+      ->register('language.default', LanguageDefault::class)
       ->addArgument('%language.default_values%');
     $this->container
-      ->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager')
+      ->register('string_translation', TranslationManager::class)
       ->addArgument(new Reference('language.default'));
     $this->container
       ->set('app.root', DRUPAL_ROOT);
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 8c92ec7..21ffdeb 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -5,17 +5,25 @@
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Component\Utility\Variable;
+use Drupal\Core\Cache\MemoryBackendFactory;
+use Drupal\Core\Config\DatabaseStorage;
 use Drupal\Core\Config\Development\ConfigSchemaChecker;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
 use Drupal\Core\Extension\ExtensionDiscovery;
+use Drupal\Core\KeyValueStore\KeyValueFactory;
 use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Lock\NullLockBackend;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\State\State;
+use Drupal\Core\StreamWrapper\PublicStream;
 use Symfony\Component\DependencyInjection\Parameter;
 use Drupal\Core\StreamWrapper\StreamWrapperInterface;
+use Drupal\Core\StreamWrapper\StreamWrapperManager;
+use Drupal\Core\StreamWrapper\TemporaryStream;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -263,10 +271,10 @@ protected function setUp() {
     file_prepare_directory($this->publicFilesDirectory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
     $this->settingsSet('file_public_path', $this->publicFilesDirectory);
     $this->streamWrappers = [];
-    $this->registerStreamWrapper('public', 'Drupal\Core\StreamWrapper\PublicStream');
+    $this->registerStreamWrapper('public', PublicStream::class);
     // The temporary stream wrapper is able to operate both with and without
     // configuration.
-    $this->registerStreamWrapper('temporary', 'Drupal\Core\StreamWrapper\TemporaryStream');
+    $this->registerStreamWrapper('temporary', TemporaryStream::class);
 
     // Manually configure the test mail collector implementation to prevent
     // tests from sending out emails and collect them in state instead.
@@ -312,11 +320,11 @@ public function containerBuild(ContainerBuilder $container) {
     // Set the default language on the minimal container.
     $this->container->setParameter('language.default_values', $this->defaultLanguageData());
 
-    $container->register('lock', 'Drupal\Core\Lock\NullLockBackend');
-    $container->register('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory');
+    $container->register('lock', NullLockBackend::class);
+    $container->register('cache_factory', MemoryBackendFactory::class);
 
     $container
-      ->register('config.storage', 'Drupal\Core\Config\DatabaseStorage')
+      ->register('config.storage', DatabaseStorage::class)
       ->addArgument(Database::getConnection())
       ->addArgument('config');
 
@@ -343,16 +351,16 @@ public function containerBuild(ContainerBuilder $container) {
       // together here, it still might a keyvalue storage for anything using
       // \Drupal::state() -- that's why a memory service was added in the first
       // place.
-      $container->register('settings', 'Drupal\Core\Site\Settings')
-        ->setFactoryClass('Drupal\Core\Site\Settings')
+      $container->register('settings', Settings::class)
+        ->setFactoryClass(Settings::class)
         ->setFactoryMethod('getInstance');
 
       $container
-        ->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueFactory')
+        ->register('keyvalue', KeyValueFactory::class)
         ->addArgument(new Reference('service_container'))
         ->addArgument(new Parameter('factory.keyvalue'));
 
-      $container->register('state', 'Drupal\Core\State\State')
+      $container->register('state', State::class)
         ->addArgument(new Reference('keyvalue'));
     }
 
@@ -371,7 +379,7 @@ public function containerBuild(ContainerBuilder $container) {
 
     // Register the stream wrapper manager.
     $container
-      ->register('stream_wrapper_manager', 'Drupal\Core\StreamWrapper\StreamWrapperManager')
+      ->register('stream_wrapper_manager', StreamWrapperManager::class)
       ->addArgument(new Reference('module_handler'))
       ->addMethodCall('setContainer', [new Reference('service_container')]);
 
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index a32c142..e281b8e 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\simpletest\Tests;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\Core\Cache\MemoryBackendFactory;
 use Drupal\Core\Test\TestDatabase;
 use Drupal\simpletest\WebTestBase;
 
@@ -213,7 +214,7 @@ public function stubTest() {
     $this->assertTrue(function_exists('simpletest_test_stub_settings_function'));
     // Check that the test-specific service file got loaded.
     $this->assertTrue($this->container->has('site.service.yml'));
-    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), 'Drupal\Core\Cache\MemoryBackendFactory');
+    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), MemoryBackendFactory::class);
 
     // These cause the two exceptions asserted in confirmStubResults().
     // Call trigger_error() without the required argument to trigger an E_WARNING.
diff --git a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
index cdfe986..ebde7fc 100644
--- a/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
+++ b/core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\simpletest\Unit;
 
+use Drupal\Component\Utility\Random;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -461,7 +462,7 @@ public function testError($status, $group) {
   public function testGetRandomGenerator() {
     $test_base = $this->getTestBaseForAssertionTests('test_id');
     $this->assertInstanceOf(
-        'Drupal\Component\Utility\Random',
+        Random::class,
         $this->invokeProtectedMethod($test_base, 'getRandomGenerator', [])
     );
   }
diff --git a/core/modules/syslog/tests/src/Kernel/SyslogTest.php b/core/modules/syslog/tests/src/Kernel/SyslogTest.php
index 22547f3..b8bcf62 100644
--- a/core/modules/syslog/tests/src/Kernel/SyslogTest.php
+++ b/core/modules/syslog/tests/src/Kernel/SyslogTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\syslog\Kernel;
 
+use Drupal\Core\Session\AccountInterface;
 use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -33,7 +34,7 @@ public function testSyslogWriting() {
     $request->headers->set('Referer', 'other-site');
     \Drupal::requestStack()->push($request);
 
-    $user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface')->getMock();
+    $user = $this->getMockBuilder(AccountInterface::class)->getMock();
     $user->method('id')->willReturn(42);
     $this->container->set('current_user', $user);
 
diff --git a/core/modules/system/src/Controller/AdminController.php b/core/modules/system/src/Controller/AdminController.php
index 3da4b09..ded05b7 100644
--- a/core/modules/system/src/Controller/AdminController.php
+++ b/core/modules/system/src/Controller/AdminController.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\system\Controller;
 
+use \Drupal\Component\Utility\SortArray;
 use Drupal\Core\Controller\ControllerBase;
 
 /**
@@ -29,7 +30,7 @@ public function index() {
       // Only display a section if there are any available tasks.
       if ($admin_tasks = system_get_module_admin_tasks($module, $info->info)) {
         // Sort links by title.
-        uasort($admin_tasks, ['\Drupal\Component\Utility\SortArray', 'sortByTitleElement']);
+        uasort($admin_tasks, [SortArray::class, 'sortByTitleElement']);
         // Move 'Configure permissions' links to the bottom of each section.
         $permission_key = "user.admin_permissions.$module";
         if (isset($admin_tasks[$permission_key])) {
diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
index 28ff7ef..fcb99ae 100644
--- a/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\system\Form;
 
+use \Drupal\Component\Utility\SortArray;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\PreExistingConfigException;
 use Drupal\Core\Config\UnmetDependenciesException;
@@ -174,7 +175,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     }
 
     // Lastly, sort all packages by title.
-    uasort($form['modules'], ['\Drupal\Component\Utility\SortArray', 'sortByTitleProperty']);
+    uasort($form['modules'], [SortArray::class, 'sortByTitleProperty']);
 
     $form['#attached']['library'][] = 'system/drupal.system.modules';
     $form['actions'] = ['#type' => 'actions'];
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
index f7f88c6..025ab7f 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -7,6 +7,8 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageDefault;
+use Drupal\Core\StringTranslation\TranslationManager;
 use Drupal\Core\Url;
 use Drupal\simpletest\WebTestBase;
 use Drupal\user\Entity\User;
@@ -310,10 +312,10 @@ protected function runDbTasks() {
     $container = new ContainerBuilder();
     $container->setParameter('language.default_values', Language::$defaultValues);
     $container
-      ->register('language.default', 'Drupal\Core\Language\LanguageDefault')
+      ->register('language.default', LanguageDefault::class)
       ->addArgument('%language.default_values%');
     $container
-      ->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager')
+      ->register('string_translation', TranslationManager::class)
       ->addArgument(new Reference('language.default'));
     \Drupal::setContainer($container);
 
diff --git a/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php b/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php
index bd6dd9c..54e7182 100644
--- a/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php
+++ b/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\database_test\Controller;
 
+use Drupal\Core\Database\Query\PagerSelectExtender;
+use Drupal\Core\Database\Query\TableSortExtender;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
@@ -42,7 +44,7 @@ public function pagerQueryEven($limit) {
 
     // This should result in 2 pages of results.
     $query = $query
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->limit($limit);
 
     $names = $query->execute()->fetchCol();
@@ -68,7 +70,7 @@ public function pagerQueryOdd($limit) {
 
     // This should result in 4 pages of results.
     $query = $query
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->limit($limit);
 
     $names = $query->execute()->fetchCol();
@@ -99,7 +101,7 @@ public function testTablesort() {
       ->fields('t', ['tid', 'pid', 'task', 'priority']);
 
     $query = $query
-      ->extend('Drupal\Core\Database\Query\TableSortExtender')
+      ->extend(TableSortExtender::class)
       ->orderByHeader($header);
 
     // We need all the results at once to check the sort.
@@ -131,7 +133,7 @@ public function testTablesortFirst() {
       ->fields('t', ['tid', 'pid', 'task', 'priority']);
 
     $query = $query
-      ->extend('Drupal\Core\Database\Query\TableSortExtender')
+      ->extend(TableSortExtender::class)
       ->orderByHeader($header)
       ->orderBy('priority');
 
diff --git a/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php b/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
index 12eebcc..dd97c7c 100644
--- a/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
+++ b/core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\database_test\Form;
 
+use Drupal\Core\Database\Query\PagerSelectExtender;
+use Drupal\Core\Database\Query\TableSortExtender;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\Entity\User;
@@ -35,8 +37,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     $count_query->addExpression('COUNT(u.uid)');
 
     $query = $query
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('Drupal\Core\Database\Query\TableSortExtender');
+      ->extend(PagerSelectExtender::class)
+      ->extend(TableSortExtender::class);
     $query
       ->fields('u', ['uid'])
       ->limit(50)
diff --git a/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php b/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php
index 6061704..1dd2f82 100644
--- a/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php
+++ b/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php
@@ -59,7 +59,7 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch =
       throw new \Exception('Deforestation');
     }
 
-    if ($this->settings->get('teapots', FALSE) && class_exists('\TypeError')) {
+    if ($this->settings->get('teapots', FALSE) && class_exists(\TypeError::class)) {
       try {
         $return = $this->app->handle($request, $type, $catch);
       }
diff --git a/core/modules/system/tests/modules/pager_test/src/Controller/PagerTestController.php b/core/modules/system/tests/modules/pager_test/src/Controller/PagerTestController.php
index 1964f74..64c9168 100644
--- a/core/modules/system/tests/modules/pager_test/src/Controller/PagerTestController.php
+++ b/core/modules/system/tests/modules/pager_test/src/Controller/PagerTestController.php
@@ -3,6 +3,7 @@
 namespace Drupal\pager_test\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 
 /**
  * Controller routine for testing the pager.
@@ -26,7 +27,7 @@ protected function buildTestTable($element, $limit) {
       ['data' => 'type'],
       ['data' => 'timestamp'],
     ];
-    $query = db_select('watchdog', 'd')->extend('Drupal\Core\Database\Query\PagerSelectExtender')->element($element);
+    $query = db_select('watchdog', 'd')->extend(PagerSelectExtender::class)->element($element);
     $result = $query
       ->fields('d', ['wid', 'type', 'timestamp'])
       ->limit($limit)
diff --git a/core/modules/system/tests/modules/plugin_test/src/Plugin/DefaultsTestPluginManager.php b/core/modules/system/tests/modules/plugin_test/src/Plugin/DefaultsTestPluginManager.php
index 65d7078..25ffc2c 100644
--- a/core/modules/system/tests/modules/plugin_test/src/Plugin/DefaultsTestPluginManager.php
+++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/DefaultsTestPluginManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\plugin_test\Plugin;
 
+use Drupal\Component\Plugin\PluginInspectionInterface;
 use Drupal\Component\Plugin\Discovery\StaticDiscovery;
 use Drupal\Component\Plugin\Factory\DefaultFactory;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -24,7 +25,7 @@ public function __construct(ModuleHandlerInterface $module_handler) {
     // discovery implementation, but StaticDiscovery lets us add some simple
     // mock plugins for unit testing.
     $this->discovery = new StaticDiscovery();
-    $this->factory = new DefaultFactory($this, 'Drupal\Component\Plugin\PluginInspectionInterface');
+    $this->factory = new DefaultFactory($this, PluginInspectionInterface::class);
     $this->moduleHandler = $module_handler;
 
     // Specify default values.
diff --git a/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
index 63e7e31..6dc2ebf 100644
--- a/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
+++ b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\system\Functional\Database;
 
+use Drupal\Core\Database\Query\PagerSelectExtender;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -86,7 +87,7 @@ public function testOddPagerQuery() {
    */
   public function testInnerPagerQuery() {
     $query = db_select('test', 't')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
+      ->extend(PagerSelectExtender::class);
     $query
       ->fields('t', ['age'])
       ->orderBy('age')
@@ -108,7 +109,7 @@ public function testInnerPagerQuery() {
    */
   public function testHavingPagerQuery() {
     $query = db_select('test', 't')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
+      ->extend(PagerSelectExtender::class);
     $query
       ->fields('t', ['name'])
       ->orderBy('name')
@@ -134,7 +135,7 @@ public function testElementNumbers() {
     \Drupal::getContainer()->get('request_stack')->push($request);
 
     $name = db_select('test', 't')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->element(2)
       ->fields('t', ['name'])
       ->orderBy('age')
@@ -146,7 +147,7 @@ public function testElementNumbers() {
     // Setting an element smaller than the previous one
     // should not overwrite the pager $maxElement with a smaller value.
     $name = db_select('test', 't')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->element(1)
       ->fields('t', ['name'])
       ->orderBy('age')
@@ -156,7 +157,7 @@ public function testElementNumbers() {
     $this->assertEqual($name, 'George', 'Pager query #2 with a specified element ID returned the correct results.');
 
     $name = db_select('test', 't')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->fields('t', ['name'])
       ->orderBy('age')
       ->limit(1)
diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
index 6bf39aa..d35c7cd 100644
--- a/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
+++ b/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\system\Kernel\Scripts;
 
+use \Drupal\Core\Command\DbDumpCommand;
+use \Drupal\Core\Command\DbImportCommand;
 use Drupal\Core\Command\DbToolsApplication;
 use Drupal\KernelTests\KernelTestBase;
 
@@ -21,7 +23,7 @@ class DbToolsApplicationTest extends KernelTestBase {
   public function testDumpCommandRegistration() {
     $application = new DbToolsApplication();
     $command = $application->find('dump');
-    $this->assertInstanceOf('\Drupal\Core\Command\DbDumpCommand', $command);
+    $this->assertInstanceOf(DbDumpCommand::class, $command);
   }
 
   /**
@@ -30,7 +32,7 @@ public function testDumpCommandRegistration() {
   public function testImportCommandRegistration() {
     $application = new DbToolsApplication();
     $command = $application->find('import');
-    $this->assertInstanceOf('\Drupal\Core\Command\DbImportCommand', $command);
+    $this->assertInstanceOf(DbImportCommand::class, $command);
   }
 
 }
diff --git a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
index d1eb8fb..cf4816d 100644
--- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
+++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
@@ -7,10 +7,20 @@
 
 namespace Drupal\Tests\system\Unit\Breadcrumbs;
 
+use \Drupal\Core\Access\AccessManagerInterface;
+use \Drupal\Core\Controller\TitleResolverInterface;
+use \Drupal\Core\PathProcessor\InboundPathProcessorInterface;
+use \Drupal\Core\Routing\RequestContext;
+use \Symfony\Component\Routing\Matcher\RequestMatcherInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Link;
 use Drupal\Core\Access\AccessResultAllowed;
+use Drupal\Core\ParamConverter\ParamNotConvertedException;
+use Drupal\Core\Path\CurrentPathStack;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Core\Url;
 use Drupal\Core\Utility\LinkGeneratorInterface;
@@ -92,17 +102,17 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->requestMatcher = $this->getMock('\Symfony\Component\Routing\Matcher\RequestMatcherInterface');
+    $this->requestMatcher = $this->getMock(RequestMatcherInterface::class);
 
     $config_factory = $this->getConfigFactoryStub(['system.site' => ['front' => 'test_frontpage']]);
 
-    $this->pathProcessor = $this->getMock('\Drupal\Core\PathProcessor\InboundPathProcessorInterface');
-    $this->context = $this->getMock('\Drupal\Core\Routing\RequestContext');
+    $this->pathProcessor = $this->getMock(InboundPathProcessorInterface::class);
+    $this->context = $this->getMock(RequestContext::class);
 
-    $this->accessManager = $this->getMock('\Drupal\Core\Access\AccessManagerInterface');
-    $this->titleResolver = $this->getMock('\Drupal\Core\Controller\TitleResolverInterface');
-    $this->currentUser = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->currentPath = $this->getMockBuilder('Drupal\Core\Path\CurrentPathStack')
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
+    $this->titleResolver = $this->getMock(TitleResolverInterface::class);
+    $this->currentUser = $this->getMock(AccountInterface::class);
+    $this->currentPath = $this->getMockBuilder(CurrentPathStack::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -119,7 +129,7 @@ protected function setUp() {
 
     $this->builder->setStringTranslation($this->getStringTranslationStub());
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -140,7 +150,7 @@ public function testBuildOnFrontpage() {
       ->method('getPathInfo')
       ->will($this->returnValue('/'));
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([], $breadcrumb->getLinks());
     $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts());
     $this->assertEquals([], $breadcrumb->getCacheTags());
@@ -157,7 +167,7 @@ public function testBuildWithOnePathElement() {
       ->method('getPathInfo')
       ->will($this->returnValue('/example'));
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([0 => new Link('Home', new Url('<front>'))], $breadcrumb->getLinks());
     $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts());
     $this->assertEquals([], $breadcrumb->getCacheTags());
@@ -192,7 +202,7 @@ public function testBuildWithTwoPathElements() {
 
     $this->setupAccessManagerToAllow();
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([0 => new Link('Home', new Url('<front>')), 1 => new Link('Example', new Url('example'))], $breadcrumb->getLinks());
     $this->assertEquals(['url.path.parent', 'user.permissions'], $breadcrumb->getCacheContexts());
     $this->assertEquals([], $breadcrumb->getCacheTags());
@@ -239,7 +249,7 @@ public function testBuildWithThreePathElements() {
         AccessResult::allowed()->cachePerPermissions(),
         AccessResult::allowed()->addCacheContexts(['bar'])->addCacheTags(['example'])
       );
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([
       new Link('Home', new Url('<front>')),
       new Link('Example', new Url('example')),
@@ -268,7 +278,7 @@ public function testBuildWithException($exception_class, $exception_argument) {
       ->method('matchRequest')
       ->will($this->throwException(new $exception_class($exception_argument)));
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
 
     // No path matched, though at least the frontpage is displayed.
     $this->assertEquals([0 => new Link('Home', new Url('<front>'))], $breadcrumb->getLinks());
@@ -287,7 +297,7 @@ public function testBuildWithException($exception_class, $exception_argument) {
    */
   public function providerTestBuildWithException() {
     return [
-      ['Drupal\Core\ParamConverter\ParamNotConvertedException', ''],
+      [ParamNotConvertedException::class, ''],
       ['Symfony\Component\Routing\Exception\MethodNotAllowedException', []],
       ['Symfony\Component\Routing\Exception\ResourceNotFoundException', ''],
     ];
@@ -312,7 +322,7 @@ public function testBuildWithNonProcessedPath() {
       ->method('matchRequest')
       ->will($this->returnValue([]));
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
 
     // No path matched, though at least the frontpage is displayed.
     $this->assertEquals([0 => new Link('Home', new Url('<front>'))], $breadcrumb->getLinks());
@@ -327,7 +337,7 @@ public function testBuildWithNonProcessedPath() {
    * @covers ::applies
    */
   public function testApplies() {
-    $this->assertTrue($this->builder->applies($this->getMock('Drupal\Core\Routing\RouteMatchInterface')));
+    $this->assertTrue($this->builder->applies($this->getMock(RouteMatchInterface::class)));
   }
 
   /**
@@ -362,7 +372,7 @@ public function testBuildWithUserPath() {
       ->with($this->anything(), $route_1)
       ->will($this->returnValue('Admin'));
 
-    $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->builder->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([0 => new Link('Home', new Url('<front>')), 1 => new Link('Admin', new Url('user_page'))], $breadcrumb->getLinks());
     $this->assertEquals(['url.path.parent', 'user.permissions'], $breadcrumb->getCacheContexts());
     $this->assertEquals([], $breadcrumb->getCacheTags());
diff --git a/core/modules/system/tests/src/Unit/Installer/InstallTranslationFilePatternTest.php b/core/modules/system/tests/src/Unit/Installer/InstallTranslationFilePatternTest.php
index 0dd7510..93e5ae9 100644
--- a/core/modules/system/tests/src/Unit/Installer/InstallTranslationFilePatternTest.php
+++ b/core/modules/system/tests/src/Unit/Installer/InstallTranslationFilePatternTest.php
@@ -28,7 +28,7 @@ class InstallTranslationFilePatternTest extends UnitTestCase {
   protected function setup() {
     parent::setUp();
     $this->fileTranslation = new FileTranslation('filename');
-    $method = new \ReflectionMethod('\Drupal\Core\StringTranslation\Translator\FileTranslation', 'getTranslationFilesPattern');
+    $method = new \ReflectionMethod(\Drupal\Core\StringTranslation\Translator\FileTranslation::class, 'getTranslationFilesPattern');
     $method->setAccessible(TRUE);
     $this->filePatternMethod = $method;
   }
diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
index c2014d5..9cddbde 100644
--- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
@@ -2,8 +2,14 @@
 
 namespace Drupal\Tests\system\Unit\Menu;
 
+use \Drupal\Core\Controller\ControllerResolverInterface;
+use \Drupal\Core\Menu\MenuActiveTrailInterface;
+use \Drupal\Core\Menu\MenuLinkManagerInterface;
+use \Drupal\Core\Menu\MenuTreeStorageInterface;
+use \Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Menu\MenuLinkTree;
 use Drupal\Core\Menu\MenuLinkTreeElement;
@@ -32,14 +38,14 @@ protected function setUp() {
     parent::setUp();
 
     $this->menuLinkTree = new MenuLinkTree(
-      $this->getMock('\Drupal\Core\Menu\MenuTreeStorageInterface'),
-      $this->getMock('\Drupal\Core\Menu\MenuLinkManagerInterface'),
-      $this->getMock('\Drupal\Core\Routing\RouteProviderInterface'),
-      $this->getMock('\Drupal\Core\Menu\MenuActiveTrailInterface'),
-      $this->getMock('\Drupal\Core\Controller\ControllerResolverInterface')
+      $this->getMock(MenuTreeStorageInterface::class),
+      $this->getMock(MenuLinkManagerInterface::class),
+      $this->getMock(RouteProviderInterface::class),
+      $this->getMock(MenuActiveTrailInterface::class),
+      $this->getMock(ControllerResolverInterface::class)
     );
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
diff --git a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
index c632a3e..3bab02f 100644
--- a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\system\Unit\Menu;
 
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Extension\ThemeHandlerInterface;
 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
 
 /**
@@ -29,7 +30,7 @@ protected function setUp() {
       'system' => 'core/modules/system',
     ];
 
-    $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
+    $this->themeHandler = $this->getMock(ThemeHandlerInterface::class);
 
     $theme = new Extension($this->root, 'theme', '/core/themes/bartik', 'bartik.info.yml');
     $theme->status = 1;
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 0ccb24b..f9baca7 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\taxonomy\Form;
 
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -387,7 +388,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     // Sort term order based on weight.
-    uasort($form_state->getValue('terms'), ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+    uasort($form_state->getValue('terms'), [SortArray::class, 'sortByWeightElement']);
 
     $vocabulary = $form_state->get(['taxonomy', 'vocabulary']);
     // Update the current hierarchy type as we go.
diff --git a/core/modules/toolbar/src/Element/Toolbar.php b/core/modules/toolbar/src/Element/Toolbar.php
index d92330b..8b28c6b 100644
--- a/core/modules/toolbar/src/Element/Toolbar.php
+++ b/core/modules/toolbar/src/Element/Toolbar.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\toolbar\Element;
 
+use \Drupal\Component\Utility\SortArray;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Render\Element\RenderElement;
 use Drupal\Core\Render\Element;
@@ -82,7 +83,7 @@ public static function preRenderToolbar($element) {
     // Allow for altering of hook_toolbar().
     $module_handler->alter('toolbar', $items);
     // Sort the children.
-    uasort($items, ['\Drupal\Component\Utility\SortArray', 'sortByWeightProperty']);
+    uasort($items, [SortArray::class, 'sortByWeightProperty']);
 
     // Merge in the original toolbar values.
     $element = array_merge($element, $items);
diff --git a/core/modules/update/tests/src/Unit/UpdateFetcherTest.php b/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
index c3e447d..ef1a902 100644
--- a/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
+++ b/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\update\Unit;
 
+use \GuzzleHttp\ClientInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\update\UpdateFetcher;
 
@@ -28,7 +29,7 @@ class UpdateFetcherTest extends UnitTestCase {
    */
   protected function setUp() {
     $config_factory = $this->getConfigFactoryStub(['update.settings' => ['fetch_url' => 'http://www.example.com']]);
-    $http_client_mock = $this->getMock('\GuzzleHttp\ClientInterface');
+    $http_client_mock = $this->getMock(ClientInterface::class);
     $this->updateFetcher = new UpdateFetcher($config_factory, $http_client_mock);
   }
 
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index f5e2e49..8c3fc16 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\user;
 
+use \Drupal\Component\Utility\Html;
 use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Entity\ContentEntityForm;
@@ -184,7 +185,7 @@ public function form(array $form, FormStateInterface $form_state) {
       '#access' => $admin,
     ];
 
-    $roles = array_map(['\Drupal\Component\Utility\Html', 'escape'], user_role_names(TRUE));
+    $roles = array_map([Html::class, 'escape'], user_role_names(TRUE));
 
     $form['account']['roles'] = [
       '#type' => 'checkboxes',
diff --git a/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php b/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
index feec81b..f8515de 100644
--- a/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
+++ b/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\user\Plugin\EntityReferenceSelection;
 
+use \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Query\Condition;
 use Drupal\Core\Database\Query\SelectInterface;
@@ -116,7 +117,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
     $form['filter']['settings'] = [
       '#type' => 'container',
       '#attributes' => ['class' => ['entity_reference-settings']],
-      '#process' => [['\Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem', 'formProcessMergeParent']],
+      '#process' => [[EntityReferenceItem::class, 'formProcessMergeParent']],
     ];
 
     if ($selection_handler_settings['filter']['type'] == 'role') {
diff --git a/core/modules/user/src/Plugin/Search/UserSearch.php b/core/modules/user/src/Plugin/Search/UserSearch.php
index 063d3ef..b6ba4d6 100644
--- a/core/modules/user/src/Plugin/Search/UserSearch.php
+++ b/core/modules/user/src/Plugin/Search/UserSearch.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -119,7 +120,7 @@ public function execute() {
     // Run the query to find matching users.
     $query = $this->database
       ->select('users_field_data', 'users')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
+      ->extend(PagerSelectExtender::class);
     $query->fields('users', ['uid']);
     $query->condition('default_langcode', 1);
     if ($this->currentUser->hasPermission('administer users')) {
diff --git a/core/modules/user/src/Plugin/views/argument_validator/User.php b/core/modules/user/src/Plugin/views/argument_validator/User.php
index e7d2139..0e95c01 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/User.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\user\Plugin\views\argument_validator;
 
+use \Drupal\Component\Utility\Html;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
@@ -60,7 +61,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
     $form['roles'] = [
       '#type' => 'checkboxes',
       '#title' => $this->t('Restrict to the selected roles'),
-      '#options' => array_map(['\Drupal\Component\Utility\Html', 'escape'], user_role_names(TRUE)),
+      '#options' => array_map([Html::class, 'escape'], user_role_names(TRUE)),
       '#default_value' => $this->options['roles'],
       '#description' => $this->t('If no roles are selected, users from any role will be allowed.'),
       '#states' => [
diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
index 6433021..115a79c 100644
--- a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\user\Kernel;
 
 use Drupal\Core\Form\FormState;
+use Drupal\Core\Installer\Form\SiteConfigureForm;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -30,7 +31,7 @@ public function testInstallConfigureForm() {
     $form_state = new FormState();
     $form_state->addBuildInfo('args', [&$install_state]);
     $form = $this->container->get('form_builder')
-      ->buildForm('Drupal\Core\Installer\Form\SiteConfigureForm', $form_state);
+      ->buildForm(SiteConfigureForm::class, $form_state);
 
     // Verify name and pass field order.
     $this->assertFieldOrder($form['admin_account']['account']);
diff --git a/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php b/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
index 84290cc..39764d5 100644
--- a/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
+++ b/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
@@ -7,6 +7,7 @@
 use Drupal\user\Access\PermissionAccessCheck;
 use Symfony\Component\Routing\Route;
 use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Session\AccountInterface;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
 /**
@@ -73,7 +74,7 @@ public function testAccess($requirements, $access, array $contexts = [], $messag
     if (!empty($message)) {
       $access_result->setReason($message);
     }
-    $user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $user = $this->getMock(AccountInterface::class);
     $user->expects($this->any())
       ->method('hasPermission')
       ->will($this->returnValueMap([
diff --git a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
index 2918d2f..08984ca 100644
--- a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
@@ -7,7 +7,9 @@
 
 namespace Drupal\Tests\user\Unit;
 
+use Drupal\Core\Controller\ControllerResolverInterface;
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\Core\StringTranslation\TranslationInterface;
@@ -61,7 +63,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->stringTranslation = new TestTranslationManager();
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
   }
 
   /**
@@ -94,7 +96,7 @@ public function testBuildPermissionsYaml() {
     $root = new vfsStreamDirectory('modules');
     vfsStreamWrapper::setRoot($root);
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('getModuleDirectories')
       ->willReturn([
@@ -169,7 +171,7 @@ public function testBuildPermissionsSortPerModule() {
     $root = new vfsStreamDirectory('modules');
     vfsStreamWrapper::setRoot($root);
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('getModuleDirectories')
       ->willReturn([
@@ -224,7 +226,7 @@ public function testBuildPermissionsYamlCallback() {
     $root = new vfsStreamDirectory('modules');
     vfsStreamWrapper::setRoot($root);
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('getModuleDirectories')
       ->willReturn([
@@ -304,7 +306,7 @@ public function testPermissionsYamlStaticAndCallback() {
     $root = new vfsStreamDirectory('modules');
     vfsStreamWrapper::setRoot($root);
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('getModuleDirectories')
       ->willReturn([
diff --git a/core/modules/user/tests/src/Unit/Plugin/Action/RoleUserTestBase.php b/core/modules/user/tests/src/Unit/Plugin/Action/RoleUserTestBase.php
index a487d82..37eaa67 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Action/RoleUserTestBase.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Action/RoleUserTestBase.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\user\Unit\Plugin\Action;
 
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -33,7 +34,7 @@ protected function setUp() {
       ->getMockBuilder('Drupal\user\Entity\User')
       ->disableOriginalConstructor()
       ->getMock();
-    $this->userRoleEntityType = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $this->userRoleEntityType = $this->getMock(EntityTypeInterface::class);
   }
 
 }
diff --git a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
index 805c96e..9644395 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\user\Unit\Plugin\Validation\Constraint;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Session\AccountProxyInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraint;
 use Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraintValidator;
@@ -18,7 +21,7 @@ class ProtectedUserFieldConstraintValidatorTest extends UnitTestCase {
    */
   protected function createValidator() {
     // Setup mocks that don't need to change.
-    $unchanged_field = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $unchanged_field = $this->getMock(FieldItemListInterface::class);
     $unchanged_field->expects($this->any())
       ->method('getValue')
       ->willReturn('unchanged-value');
@@ -31,7 +34,7 @@ protected function createValidator() {
     $user_storage->expects($this->any())
       ->method('loadUnchanged')
       ->willReturn($unchanged_account);
-    $current_user = $this->getMock('Drupal\Core\Session\AccountProxyInterface');
+    $current_user = $this->getMock(AccountProxyInterface::class);
     $current_user->expects($this->any())
       ->method('id')
       ->willReturn('current-user');
@@ -75,8 +78,8 @@ public function providerTestValidate() {
     $cases[] = [NULL, FALSE];
 
     // Case 2: Empty user should be ignored.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -86,10 +89,10 @@ public function providerTestValidate() {
     $cases[] = [$items, FALSE];
 
     // Case 3: Account flagged to skip protected user should be ignored.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $account = $this->getMock('Drupal\user\UserInterface');
     $account->_skipProtectedUserFieldConstraint = TRUE;
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -99,12 +102,12 @@ public function providerTestValidate() {
     $cases[] = [$items, FALSE];
 
     // Case 4: New user should be ignored.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $account = $this->getMock('Drupal\user\UserInterface');
     $account->expects($this->once())
       ->method('isNew')
       ->willReturn(TRUE);
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -121,7 +124,7 @@ public function providerTestValidate() {
     $account->expects($this->once())
       ->method('id')
       ->willReturn('not-current-user');
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -131,7 +134,7 @@ public function providerTestValidate() {
     $cases[] = [$items, FALSE];
 
     // Case 6: Non-password fields that have not changed should be ignored.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->exactly(2))
       ->method('getName')
       ->willReturn('field_not_password');
@@ -144,7 +147,7 @@ public function providerTestValidate() {
       ->willReturn('current-user');
     $account->expects($this->never())
       ->method('checkExistingPassword');
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -157,7 +160,7 @@ public function providerTestValidate() {
     $cases[] = [$items, FALSE];
 
     // Case 7: Password field with no value set should be ignored.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->once())
       ->method('getName')
       ->willReturn('pass');
@@ -170,7 +173,7 @@ public function providerTestValidate() {
       ->willReturn('current-user');
     $account->expects($this->never())
       ->method('checkExistingPassword');
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -181,7 +184,7 @@ public function providerTestValidate() {
 
     // Case 8: Non-password field changed, but user has passed provided current
     // password.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->exactly(2))
       ->method('getName')
       ->willReturn('field_not_password');
@@ -195,7 +198,7 @@ public function providerTestValidate() {
     $account->expects($this->once())
       ->method('checkExistingPassword')
       ->willReturn(TRUE);
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -208,7 +211,7 @@ public function providerTestValidate() {
     $cases[] = [$items, FALSE];
 
     // Case 9: Password field changed, current password confirmed.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->exactly(2))
       ->method('getName')
       ->willReturn('pass');
@@ -222,7 +225,7 @@ public function providerTestValidate() {
     $account->expects($this->once())
       ->method('checkExistingPassword')
       ->willReturn(TRUE);
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -241,7 +244,7 @@ public function providerTestValidate() {
     // The below calls should result in a violation.
 
     // Case 10: Password field changed, current password not confirmed.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->exactly(2))
       ->method('getName')
       ->willReturn('pass');
@@ -258,7 +261,7 @@ public function providerTestValidate() {
     $account->expects($this->once())
       ->method('checkExistingPassword')
       ->willReturn(FALSE);
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
@@ -275,7 +278,7 @@ public function providerTestValidate() {
     $cases[] = [$items, TRUE, 'Password'];
 
     // Case 11: Non-password field changed, current password not confirmed.
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->exactly(2))
       ->method('getName')
       ->willReturn('field_not_password');
@@ -292,7 +295,7 @@ public function providerTestValidate() {
     $account->expects($this->once())
       ->method('checkExistingPassword')
       ->willReturn(FALSE);
-    $items = $this->getMock('Drupal\Core\Field\FieldItemListInterface');
+    $items = $this->getMock(FieldItemListInterface::class);
     $items->expects($this->once())
       ->method('getFieldDefinition')
       ->willReturn($field_definition);
diff --git a/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php b/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
index 11a970a..1b21803 100644
--- a/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
@@ -3,6 +3,9 @@
 namespace Drupal\Tests\user\Unit\Plugin\views\field;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\Plugin\views\field\UserBulkForm;
 
@@ -41,18 +44,18 @@ public function testConstructor() {
       ->will($this->returnValue('node'));
     $actions[] = $action;
 
-    $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_storage = $this->getMock(EntityStorageInterface::class);
     $entity_storage->expects($this->any())
       ->method('loadMultiple')
       ->will($this->returnValue($actions));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->once())
       ->method('getStorage')
       ->with('action')
       ->will($this->returnValue($entity_storage));
 
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
 
     $views_data = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
diff --git a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php
index 8d18811..d46b256 100644
--- a/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php
+++ b/core/modules/user/tests/src/Unit/PrivateTempStoreTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\user\Unit;
 
+use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Session\AccountProxyInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\PrivateTempStore;
 use Drupal\user\TempStoreException;
@@ -69,9 +72,9 @@ class PrivateTempStoreTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->keyValue = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
-    $this->currentUser = $this->getMock('Drupal\Core\Session\AccountProxyInterface');
+    $this->keyValue = $this->getMock(KeyValueStoreExpirableInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
+    $this->currentUser = $this->getMock(AccountProxyInterface::class);
     $this->currentUser->expects($this->any())
       ->method('id')
       ->willReturn(1);
diff --git a/core/modules/user/tests/src/Unit/SharedTempStoreTest.php b/core/modules/user/tests/src/Unit/SharedTempStoreTest.php
index 33bde41..ad35907 100644
--- a/core/modules/user/tests/src/Unit/SharedTempStoreTest.php
+++ b/core/modules/user/tests/src/Unit/SharedTempStoreTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\user\Unit;
 
+use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
+use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\SharedTempStore;
 use Drupal\user\TempStoreException;
@@ -69,8 +71,8 @@ class SharedTempStoreTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->keyValue = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+    $this->keyValue = $this->getMock(KeyValueStoreExpirableInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
     $this->requestStack = new RequestStack();
     $request = Request::createFromGlobals();
     $this->requestStack->push($request);
diff --git a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
index 216e8d6..5bdd6a3 100644
--- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
@@ -2,9 +2,14 @@
 
 namespace Drupal\Tests\user\Unit;
 
+use \Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\Container;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemList;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\UserAccessControlHandler;
 
@@ -66,7 +71,7 @@ protected function setUp() {
     $container->set('cache_contexts_manager', $cache_contexts_manager);
     \Drupal::setContainer($container);
 
-    $this->viewer = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $this->viewer = $this->getMock(AccountInterface::class);
     $this->viewer
       ->expects($this->any())
       ->method('hasPermission')
@@ -76,7 +81,7 @@ protected function setUp() {
       ->method('id')
       ->will($this->returnValue(1));
 
-    $this->owner = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $this->owner = $this->getMock(AccountInterface::class);
     $this->owner
       ->expects($this->any())
       ->method('hasPermission')
@@ -90,22 +95,22 @@ protected function setUp() {
       ->method('id')
       ->will($this->returnValue(2));
 
-    $this->admin = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $this->admin = $this->getMock(AccountInterface::class);
     $this->admin
       ->expects($this->any())
       ->method('hasPermission')
       ->will($this->returnValue(TRUE));
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
 
     $this->accessControlHandler = new UserAccessControlHandler($entity_type);
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $module_handler->expects($this->any())
       ->method('getImplementations')
       ->will($this->returnValue([]));
     $this->accessControlHandler->setModuleHandler($module_handler);
 
-    $this->items = $this->getMockBuilder('Drupal\Core\Field\FieldItemList')
+    $this->items = $this->getMockBuilder(FieldItemList::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->items
@@ -118,7 +123,7 @@ protected function setUp() {
    * Asserts correct field access grants for a field.
    */
   public function assertFieldAccess($field, $viewer, $target, $view, $edit) {
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->any())
       ->method('getName')
       ->will($this->returnValue($field));
diff --git a/core/modules/user/tests/src/Unit/UserAuthTest.php b/core/modules/user/tests/src/Unit/UserAuthTest.php
index 698c8b5..50beb23 100644
--- a/core/modules/user/tests/src/Unit/UserAuthTest.php
+++ b/core/modules/user/tests/src/Unit/UserAuthTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\user\Unit;
 
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Password\PasswordInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\UserAuth;
 
@@ -57,15 +60,15 @@ class UserAuthTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->userStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $this->userStorage = $this->getMock(EntityStorageInterface::class);
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->any())
       ->method('getStorage')
       ->with('user')
       ->will($this->returnValue($this->userStorage));
 
-    $this->passwordService = $this->getMock('Drupal\Core\Password\PasswordInterface');
+    $this->passwordService = $this->getMock(PasswordInterface::class);
 
     $this->testUser = $this->getMockBuilder('Drupal\user\Entity\User')
       ->disableOriginalConstructor()
diff --git a/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php b/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
index b8f2888..6c347d1 100644
--- a/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
+++ b/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
@@ -3,6 +3,9 @@
 namespace Drupal\Tests\user\Unit\Views\Argument;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\Entity\Role;
 use Drupal\user\Plugin\views\argument\RolesRid;
@@ -29,7 +32,7 @@ public function testTitleQuery() {
     ], 'user_role');
 
     // Creates a stub entity storage;
-    $role_storage = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityStorageInterface');
+    $role_storage = $this->getMockForAbstractClass(EntityStorageInterface::class);
     $role_storage->expects($this->any())
       ->method('loadMultiple')
       ->will($this->returnValueMap([
@@ -38,13 +41,13 @@ public function testTitleQuery() {
         [['test_rid_1', 'test_rid_2'], ['test_rid_1' => $role1, 'test_rid_2' => $role2]],
       ]));
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->any())
       ->method('getKey')
       ->with('label')
       ->will($this->returnValue('label'));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->any())
       ->method('getDefinition')
       ->with($this->equalTo('user_role'))
diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
index 335fd99..c8b3ddf 100644
--- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
@@ -11,6 +11,7 @@
 use Drupal\user\RoleInterface;
 use Drupal\views\Plugin\views\HandlerBase;
 use Drupal\Component\Utility\Html;
+use Drupal\Component\Utility\SortArray;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
 
@@ -722,7 +723,7 @@ protected function validateIdentifier($identifier, FormStateInterface $form_stat
   protected function buildGroupSubmit($form, FormStateInterface $form_state) {
     $groups = [];
     $group_items = $form_state->getValue(['options', 'group_info', 'group_items']);
-    uasort($group_items, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
+    uasort($group_items, [SortArray::class, 'sortByWeightElement']);
     // Filter out removed items.
 
     // Start from 1 to avoid problems with #default_value in the widget.
diff --git a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
index f766975..57a2cb6 100644
--- a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
@@ -2,7 +2,17 @@
 
 namespace Drupal\Tests\views\Unit\Controller;
 
+use \Drupal\Core\Controller\ControllerResolverInterface;
+use \Drupal\Core\Render\ElementInfoManagerInterface;
+use \Drupal\Core\Render\PlaceholderGeneratorInterface;
+use \Drupal\Core\Render\RenderCacheInterface;
+use \Drupal\Core\Render\RendererInterface;
+use \Drupal\Core\Routing\RedirectDestinationInterface;
+use \Drupal\Core\Theme\ThemeManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Path\CurrentPathStack;
 use Drupal\Core\Render\RenderContext;
+use Drupal\Core\Render\Renderer;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Ajax\ViewAjaxResponse;
 use Drupal\views\Controller\ViewAjaxController;
@@ -64,11 +74,11 @@ class ViewAjaxControllerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->viewStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $this->viewStorage = $this->getMock(EntityStorageInterface::class);
     $this->executableFactory = $this->getMockBuilder('Drupal\views\ViewExecutableFactory')
       ->disableOriginalConstructor()
       ->getMock();
-    $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
     $this->renderer->expects($this->any())
       ->method('render')
       ->will($this->returnCallback(function(array &$elements) {
@@ -80,22 +90,22 @@ protected function setUp() {
       ->willReturnCallback(function (RenderContext $context, callable $callable) {
         return $callable();
       });
-    $this->currentPath = $this->getMockBuilder('Drupal\Core\Path\CurrentPathStack')
+    $this->currentPath = $this->getMockBuilder(CurrentPathStack::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->redirectDestination = $this->getMock('\Drupal\Core\Routing\RedirectDestinationInterface');
+    $this->redirectDestination = $this->getMock(RedirectDestinationInterface::class);
 
     $this->viewAjaxController = new ViewAjaxController($this->viewStorage, $this->executableFactory, $this->renderer, $this->currentPath, $this->redirectDestination);
 
-    $element_info_manager = $this->getMock('\Drupal\Core\Render\ElementInfoManagerInterface');
+    $element_info_manager = $this->getMock(ElementInfoManagerInterface::class);
     $request_stack = new RequestStack();
     $request_stack->push(new Request());
     $args = [
-      $this->getMock('\Drupal\Core\Controller\ControllerResolverInterface'),
-      $this->getMock('\Drupal\Core\Theme\ThemeManagerInterface'),
+      $this->getMock(ControllerResolverInterface::class),
+      $this->getMock(ThemeManagerInterface::class),
       $element_info_manager,
-      $this->getMock('\Drupal\Core\Render\PlaceholderGeneratorInterface'),
-      $this->getMock('\Drupal\Core\Render\RenderCacheInterface'),
+      $this->getMock(PlaceholderGeneratorInterface::class),
+      $this->getMock(RenderCacheInterface::class),
       $request_stack,
       [
         'required_cache_contexts' => [
@@ -104,7 +114,7 @@ protected function setUp() {
         ],
       ],
     ];
-    $this->renderer = $this->getMockBuilder('Drupal\Core\Render\Renderer')
+    $this->renderer = $this->getMockBuilder(Renderer::class)
       ->setConstructorArgs($args)
       ->setMethods(NULL)
       ->getMock();
diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
index 74bcc08..9d43b5e 100644
--- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -7,17 +7,25 @@
 
 namespace Drupal\Tests\views\Unit;
 
+use \Drupal\Core\Entity\EntityListBuilder;
+use \Drupal\Core\Field\Plugin\Field\FieldType\StringLongItem;
 use Drupal\Core\Config\Entity\ConfigEntityType;
 use Drupal\Core\Entity\ContentEntityType;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\Sql\DefaultTableMapping;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldTypePluginManager;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\Core\Field\Plugin\Field\FieldType\IntegerItem;
 use Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem;
 use Drupal\Core\Field\Plugin\Field\FieldType\StringItem;
 use Drupal\Core\Field\Plugin\Field\FieldType\UriItem;
 use Drupal\Core\Field\Plugin\Field\FieldType\UuidItem;
+use Drupal\Core\TypedData\DataDefinitionInterface;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
 use Drupal\text\Plugin\Field\FieldType\TextLongItem;
 use Drupal\entity_test\Entity\EntityTest;
@@ -79,20 +87,20 @@ class EntityViewsDataTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityStorage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $this->entityStorage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
     $typed_data_manager = $this->getMock(TypedDataManagerInterface::class);
     $typed_data_manager->expects($this->any())
       ->method('createDataDefinition')
-      ->willReturn($this->getMock('Drupal\Core\TypedData\DataDefinitionInterface'));
+      ->willReturn($this->getMock(DataDefinitionInterface::class));
 
     $typed_data_manager->expects($this->any())
       ->method('getDefinition')
       ->with($this->equalTo('field_item:string_long'))
-      ->willReturn(['class' => '\Drupal\Core\Field\Plugin\Field\FieldType\StringLongItem']);
+      ->willReturn(['class' => StringLongItem::class]);
 
     $this->baseEntityType = new TestEntityType([
       'base_table' => 'entity_test',
@@ -110,11 +118,11 @@ protected function setUp() {
     ]);
 
     $this->translationManager = $this->getStringTranslationStub();
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
     $this->viewsData = new TestEntityViewsData($this->baseEntityType, $this->entityStorage, $this->entityManager, $this->moduleHandler, $this->translationManager);
 
-    $field_type_manager = $this->getMockBuilder('Drupal\Core\Field\FieldTypePluginManager')
+    $field_type_manager = $this->getMockBuilder(FieldTypePluginManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $field_type_manager->expects($this->any())
@@ -360,35 +368,35 @@ public function testRevisionTableWithRevisionDataTable() {
    * Helper method to mock all store definitions.
    */
   protected function setupFieldStorageDefinition() {
-    $id_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $id_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $id_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(IntegerItem::schema($id_field_storage_definition));
-    $uuid_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $uuid_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $uuid_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(UuidItem::schema($uuid_field_storage_definition));
-    $type_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $type_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $type_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(StringItem::schema($type_field_storage_definition));
-    $langcode_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $langcode_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $langcode_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(LanguageItem::schema($langcode_field_storage_definition));
-    $name_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $name_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $name_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(StringItem::schema($name_field_storage_definition));
-    $description_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $description_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $description_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(TextLongItem::schema($description_field_storage_definition));
-    $homepage_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $homepage_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $homepage_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(UriItem::schema($homepage_field_storage_definition));
-    $string_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $string_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $string_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(StringItem::schema($string_field_storage_definition));
@@ -400,7 +408,7 @@ protected function setupFieldStorageDefinition() {
           ['user', TRUE, static::userEntityInfo()],
         ]
       );
-    $user_id_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $user_id_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $user_id_field_storage_definition->expects($this->any())
       ->method('getSetting')
       ->with('target_type')
@@ -412,7 +420,7 @@ protected function setupFieldStorageDefinition() {
       ->method('getSchema')
       ->willReturn(EntityReferenceItem::schema($user_id_field_storage_definition));
 
-    $revision_id_field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $revision_id_field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $revision_id_field_storage_definition->expects($this->any())
       ->method('getSchema')
       ->willReturn(IntegerItem::schema($revision_id_field_storage_definition));
@@ -945,7 +953,7 @@ public function testGetViewsDataWithoutEntityOperations() {
    * @covers ::getViewsData
    */
   public function testGetViewsDataWithEntityOperations() {
-    $this->baseEntityType->setListBuilderClass('\Drupal\Core\Entity\EntityListBuilder');
+    $this->baseEntityType->setListBuilderClass(EntityListBuilder::class);
     $data = $this->viewsData->getViewsData();
     $this->assertSame('entity_operations', $data[$this->baseEntityType->getBaseTable()]['operations']['field']['id']);
   }
diff --git a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
index c89554a..5b57ac8 100644
--- a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
+++ b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
@@ -7,6 +7,9 @@
 
 namespace Drupal\Tests\views\Unit\EventSubscriber;
 
+use \Drupal\Core\State\StateInterface;
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\EventSubscriber\RouteSubscriber;
@@ -48,15 +51,15 @@ class RouteSubscriberTest extends UnitTestCase {
   protected $state;
 
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->viewStorage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->viewStorage = $this->getMockBuilder(ConfigEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->entityManager->expects($this->any())
       ->method('getStorage')
       ->with('view')
       ->will($this->returnValue($this->viewStorage));
-    $this->state = $this->getMock('\Drupal\Core\State\StateInterface');
+    $this->state = $this->getMock(StateInterface::class);
     $this->routeSubscriber = new TestRouteSubscriber($this->entityManager, $this->state);
   }
 
diff --git a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
index cbe6ade..0e04a22 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
@@ -2,7 +2,10 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\Block;
 
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Executable\ExecutableManagerInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\Block\ViewsBlock;
 
@@ -59,7 +62,7 @@ class ViewsBlockTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp(); // TODO: Change the autogenerated stub
-    $condition_plugin_manager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
+    $condition_plugin_manager = $this->getMock(ExecutableManagerInterface::class);
     $condition_plugin_manager->expects($this->any())
       ->method('getDefinitions')
       ->will($this->returnValue([]));
@@ -118,7 +121,7 @@ protected function setUp() {
 
     $this->executable->display_handler = $this->displayHandler;
 
-    $this->storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
+    $this->storage = $this->getMockBuilder(ConfigEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -126,7 +129,7 @@ protected function setUp() {
       ->method('load')
       ->with('test_view')
       ->will($this->returnValue($this->view));
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->account = $this->getMock(AccountInterface::class);
   }
 
   /**
diff --git a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
index 7ecf9ef..65e47e7 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
@@ -7,6 +7,9 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\Derivative;
 
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\Derivative\ViewsLocalTask;
 use Symfony\Component\Routing\Route;
@@ -50,9 +53,9 @@ class ViewsLocalTaskTest extends UnitTestCase {
   protected $localTaskDerivative;
 
   protected function setUp() {
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $this->state = $this->getMock('Drupal\Core\State\StateInterface');
-    $this->viewStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
+    $this->state = $this->getMock(StateInterface::class);
+    $this->viewStorage = $this->getMock(EntityStorageInterface::class);
 
     $this->localTaskDerivative = new TestViewsLocalTask($this->routeProvider, $this->state, $this->viewStorage);
   }
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
index 556aef9..3edfb8e 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
@@ -2,6 +2,12 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\area;
 
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\EntityViewBuilderInterface;
+use Drupal\Core\Utility\Token;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\area\Entity;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -67,9 +73,9 @@ class EntityTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->entityStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
-    $this->entityViewBuilder = $this->getMock('Drupal\Core\Entity\EntityViewBuilderInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->entityStorage = $this->getMock(EntityStorageInterface::class);
+    $this->entityViewBuilder = $this->getMock(EntityViewBuilderInterface::class);
 
     $this->executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
       ->disableOriginalConstructor()
@@ -93,7 +99,7 @@ protected function setUp() {
       ->willReturn($this->stylePlugin);
 
 
-    $token = $this->getMockBuilder('Drupal\Core\Utility\Token')
+    $token = $this->getMockBuilder(Token::class)
       ->disableOriginalConstructor()
       ->getMock();
     $token->expects($this->any())
@@ -145,7 +151,7 @@ public function testRenderWithId() {
     ];
 
     /** @var \Drupal\Core\Entity\EntityInterface $entity */
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->once())
       ->method('access')
       ->willReturn(TRUE);
@@ -180,7 +186,7 @@ public function testRenderWithIdAndToken($token, $id) {
       'tokenize' => TRUE,
     ];
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->once())
       ->method('access')
       ->willReturn(TRUE);
@@ -219,7 +225,7 @@ public function testRenderWithUuid() {
       'target' => $uuid,
       'tokenize' => FALSE,
     ];
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->once())
       ->method('access')
       ->willReturn(TRUE);
@@ -263,8 +269,8 @@ public function testCalculateDependenciesWithUuid() {
     $this->setupEntityManager();
 
     $uuid = '1d52762e-b9d8-4177-908f-572d1a5845a4';
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity = $this->getMock(EntityInterface::class);
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity->expects($this->once())
       ->method('getConfigDependencyName')
       ->willReturn('entity_test:test-bundle:1d52762e-b9d8-4177-908f-572d1a5845a4');
@@ -294,8 +300,8 @@ public function testCalculateDependenciesWithUuid() {
   public function testCalculateDependenciesWithEntityId() {
     $this->setupEntityManager();
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity = $this->getMock(EntityInterface::class);
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity->expects($this->once())
       ->method('getConfigDependencyName')
       ->willReturn('entity_test:test-bundle:1d52762e-b9d8-4177-908f-572d1a5845a4');
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
index 91d5282..4fcf22a 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\area;
 
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\area\View as ViewAreaPlugin;
 
@@ -30,7 +31,7 @@ class ViewTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->entityStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $this->entityStorage = $this->getMock(EntityStorageInterface::class);
     $this->viewHandler = new ViewAreaPlugin([], 'view', [], $this->entityStorage);
     $this->viewHandler->view = $this->getMockBuilder('Drupal\views\ViewExecutable')
       ->disableOriginalConstructor()
diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
index 62c89a9..a85ec45 100644
--- a/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\argument_default;
 
+use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\Path\CurrentPathStack;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\argument_default\Raw;
@@ -33,7 +34,7 @@ public function testGetArgument() {
     $view->expects($this->any())
       ->method('getRequest')
       ->will($this->returnValue($request));
-    $alias_manager = $this->getMock('Drupal\Core\Path\AliasManagerInterface');
+    $alias_manager = $this->getMock(AliasManagerInterface::class);
     $alias_manager->expects($this->never())
       ->method('getAliasByPath');
 
@@ -71,7 +72,7 @@ public function testGetArgument() {
     $this->assertEquals(NULL, $raw->getArgument());
 
     // Setup an alias manager with a path alias.
-    $alias_manager = $this->getMock('Drupal\Core\Path\AliasManagerInterface');
+    $alias_manager = $this->getMock(AliasManagerInterface::class);
     $alias_manager->expects($this->any())
       ->method('getAliasByPath')
       ->with($this->equalTo('/test/example'))
diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
index 13a7bc9..0da2847 100644
--- a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\argument_validator;
 
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\argument_validator\Entity;
 
@@ -45,9 +49,9 @@ class EntityTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $mock_entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [], '', FALSE, TRUE, TRUE, ['bundle', 'access']);
+    $mock_entity = $this->getMockForAbstractClass(\Drupal\Core\Entity\Entity::class, [], '', FALSE, TRUE, TRUE, ['bundle', 'access']);
     $mock_entity->expects($this->any())
       ->method('bundle')
       ->will($this->returnValue('test_bundle'));
@@ -59,7 +63,7 @@ protected function setUp() {
         ['test_op_3', NULL, FALSE, TRUE],
       ]));
 
-    $mock_entity_bundle_2 = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [], '', FALSE, TRUE, TRUE, ['bundle', 'access']);
+    $mock_entity_bundle_2 = $this->getMockForAbstractClass(\Drupal\Core\Entity\Entity::class, [], '', FALSE, TRUE, TRUE, ['bundle', 'access']);
     $mock_entity_bundle_2->expects($this->any())
       ->method('bundle')
       ->will($this->returnValue('test_bundle_2'));
@@ -72,7 +76,7 @@ protected function setUp() {
       ]));
 
 
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
 
     // Setup values for IDs passed as strings or numbers.
     $value_map = [
@@ -175,10 +179,10 @@ public function testValidateArgumentBundle() {
   public function testCalculateDependencies() {
     // Create an entity manager, storage, entity type, and entity to mock the
     // loading of entities providing bundles.
-    $entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
-    $mock_entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entityManager = $this->getMock(EntityManagerInterface::class);
+    $storage = $this->getMock(EntityStorageInterface::class);
+    $entity_type = $this->getMock(EntityTypeInterface::class);
+    $mock_entity = $this->getMock(EntityInterface::class);
 
     $mock_entity->expects($this->any())
       ->method('getConfigDependencyKey')
diff --git a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
index 08ec780..f8d378a 100644
--- a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
@@ -7,7 +7,9 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\display;
 
+use \Drupal\Core\State\StateInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
@@ -52,8 +54,8 @@ class PathPluginBaseTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $this->state = $this->getMock('\Drupal\Core\State\StateInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
+    $this->state = $this->getMock(StateInterface::class);
     $this->pathPlugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->setConstructorArgs([[], 'path_base', [], $this->routeProvider, $this->state])
       ->setMethods(NULL)
@@ -438,7 +440,7 @@ public function testAlterRoutesWithParameters() {
 
     // Ensure that the test_route is overridden.
     $route = $collection->get('test_route');
-    $this->assertInstanceOf('\Symfony\Component\Routing\Route', $route);
+    $this->assertInstanceOf(\Symfony\Component\Routing\Route::class, $route);
     $this->assertEquals('test_id', $route->getDefault('view_id'));
     $this->assertEquals('page_1', $route->getDefault('display_id'));
     // Ensure that the path did not changed and placeholders are respected.
@@ -475,7 +477,7 @@ public function testAlterRoutesWithParametersAndUpcasting() {
 
     // Ensure that the test_route is overridden.
     $route = $collection->get('test_route');
-    $this->assertInstanceOf('\Symfony\Component\Routing\Route', $route);
+    $this->assertInstanceOf(\Symfony\Component\Routing\Route::class, $route);
     $this->assertEquals('test_id', $route->getDefault('view_id'));
     $this->assertEquals('page_1', $route->getDefault('display_id'));
     $this->assertEquals(['taxonomy_term' => 'entity:entity_test'], $route->getOption('parameters'));
@@ -511,7 +513,7 @@ public function testAlterRoutesWithOptionalParameters() {
 
     // Ensure that the test_route is overridden.
     $route = $collection->get('test_route');
-    $this->assertInstanceOf('\Symfony\Component\Routing\Route', $route);
+    $this->assertInstanceOf(\Symfony\Component\Routing\Route::class, $route);
     $this->assertEquals('test_id', $route->getDefault('view_id'));
     $this->assertEquals('page_1', $route->getDefault('display_id'));
     // Ensure that the path did not changed and placeholders are respected.
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
index 4d67c00..eeb4bee 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\field;
 
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Entity\View;
 use Drupal\views\Plugin\views\field\Counter;
@@ -65,11 +67,11 @@ protected function setUp() {
     ];
 
     $storage = new View($config, 'view');
-    $user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $user = $this->getMock(AccountInterface::class);
     $views_data = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
     $this->view = $this->getMock('Drupal\views\ViewExecutable', NULL, [$storage, $user, $views_data, $route_provider]);
 
     $this->display = $this->getMockBuilder('Drupal\views\Plugin\views\display\DisplayPluginBase')
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index 0b33a58..b7a0e2c 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -7,13 +7,21 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\field;
 
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\GeneratedUrl;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Path\PathValidatorInterface;
+use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
 use Drupal\Core\Render\Markup;
+use Drupal\Core\Render\RendererInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Url;
 use Drupal\Core\Utility\LinkGenerator;
 use Drupal\Core\Utility\LinkGeneratorInterface;
 use Drupal\Core\Utility\UnroutedUrlAssembler;
+use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\ResultRow;
@@ -140,22 +148,22 @@ protected function setUp() {
       ->disableOriginalConstructor()
       ->getMock();
 
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
     $route_provider->expects($this->any())
       ->method('getRouteByName')
       ->with('test_route')
       ->willReturn(new Route('/test-path'));
 
-    $this->urlGenerator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
-    $this->pathValidator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
+    $this->pathValidator = $this->getMock(PathValidatorInterface::class);
 
     $this->requestStack = new RequestStack();
     $this->requestStack->push(new Request());
 
-    $this->unroutedUrlAssembler = $this->getMock('Drupal\Core\Utility\UnroutedUrlAssemblerInterface');
-    $this->linkGenerator = $this->getMock('Drupal\Core\Utility\LinkGeneratorInterface');
+    $this->unroutedUrlAssembler = $this->getMock(UnroutedUrlAssemblerInterface::class);
+    $this->linkGenerator = $this->getMock(LinkGeneratorInterface::class);
 
-    $this->renderer = $this->getMock('Drupal\Core\Render\RendererInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
 
     $container_builder = new ContainerBuilder();
     $container_builder->set('url_generator', $this->urlGenerator);
@@ -170,12 +178,12 @@ protected function setUp() {
    * Sets up the unrouted url assembler and the link generator.
    */
   protected function setUpUrlIntegrationServices() {
-    $this->pathProcessor = $this->getMock('Drupal\Core\PathProcessor\OutboundPathProcessorInterface');
+    $this->pathProcessor = $this->getMock(OutboundPathProcessorInterface::class);
     $this->unroutedUrlAssembler = new UnroutedUrlAssembler($this->requestStack, $this->pathProcessor);
 
     \Drupal::getContainer()->set('unrouted_url_assembler', $this->unroutedUrlAssembler);
 
-    $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'), $this->renderer);
+    $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->getMock(ModuleHandlerInterface::class), $this->renderer);
     $this->renderer
       ->method('render')
       ->willReturnCallback(
@@ -365,7 +373,7 @@ public function providerTestRenderAsLinkWithPathAndOptions() {
     // executed for paths which aren't routed.
 
     // Entity flag.
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $data[] = ['test-path', ['entity' => $entity], '<a href="/test-path">value</a>'];
     // entity_type flag.
     $entity_type_id = 'node';
@@ -499,7 +507,7 @@ public function providerTestRenderAsLinkWithUrlAndOptions() {
     $data[] = [$url, ['language' => $language], $url_with_language, '/fr/test-path', clone $url_with_language, '<a href="/fr/test-path" hreflang="fr">value</a>'];
 
     // Entity flag.
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $url = Url::fromRoute('test_route');
     $url_with_entity = Url::fromRoute('test_route');
     $options = ['entity' => $entity] + $this->defaultUrlOptions;
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
index 2b929f3..cc766f9 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@@ -7,7 +7,17 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\field;
 
+use \Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\EntityAccessControlHandlerInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
+use Drupal\Core\Entity\Sql\TableMappingInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldTypePluginManagerInterface;
+use Drupal\Core\Field\FormatterPluginManager;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Render\RendererInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Tests\views\Unit\Plugin\HandlerTestTrait;
 use Drupal\views\Plugin\views\field\EntityField;
@@ -70,12 +80,12 @@ class FieldTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->formatterPluginManager = $this->getMockBuilder('Drupal\Core\Field\FormatterPluginManager')
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->formatterPluginManager = $this->getMockBuilder(FormatterPluginManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
-    $this->fieldTypePluginManager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $this->fieldTypePluginManager = $this->getMock(FieldTypePluginManagerInterface::class);
     $this->fieldTypePluginManager->expects($this->any())
       ->method('getDefaultStorageSettings')
       ->willReturn([]);
@@ -83,8 +93,8 @@ protected function setUp() {
       ->method('getDefaultFieldSettings')
       ->willReturn([]);
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
-    $this->renderer = $this->getMock('Drupal\Core\Render\RendererInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
+    $this->renderer = $this->getMock(RendererInterface::class);
 
     $this->setupExecutableAndView();
     $this->setupViewsData();
@@ -266,7 +276,7 @@ public function testAccess() {
         'table' => ['entity type' => 'test_entity']
       ]);
 
-    $access_control_handler = $this->getMock('Drupal\Core\Entity\EntityAccessControlHandlerInterface');
+    $access_control_handler = $this->getMock(EntityAccessControlHandlerInterface::class);
     $this->entityManager->expects($this->atLeastOnce())
       ->method('getAccessControlHandler')
       ->with('test_entity')
@@ -280,7 +290,7 @@ public function testAccess() {
         'title' => $title_storage,
       ]);
 
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
 
     $access_control_handler->expects($this->atLeastOnce())
       ->method('fieldAccess')
@@ -334,13 +344,13 @@ public function testClickSortWithBaseField($order) {
         'title' => $field_storage,
       ]);
 
-    $table_mapping = $this->getMock('Drupal\Core\Entity\Sql\TableMappingInterface');
+    $table_mapping = $this->getMock(TableMappingInterface::class);
     $table_mapping
       ->expects($this->atLeastOnce())
       ->method('getFieldColumnName')
       ->with($field_storage, 'value')
       ->willReturn('title');
-    $entity_storage = $this->getMock('Drupal\Core\Entity\Sql\SqlEntityStorageInterface');
+    $entity_storage = $this->getMock(SqlEntityStorageInterface::class);
     $entity_storage->expects($this->atLeastOnce())
       ->method('getTableMapping')
       ->willReturn($table_mapping);
@@ -394,13 +404,13 @@ public function testClickSortWithConfiguredField($order) {
         'body' => $field_storage,
       ]);
 
-    $table_mapping = $this->getMock('Drupal\Core\Entity\Sql\TableMappingInterface');
+    $table_mapping = $this->getMock(TableMappingInterface::class);
     $table_mapping
       ->expects($this->atLeastOnce())
       ->method('getFieldColumnName')
       ->with($field_storage, 'value')
       ->willReturn('body_value');
-    $entity_storage = $this->getMock('Drupal\Core\Entity\Sql\SqlEntityStorageInterface');
+    $entity_storage = $this->getMock(SqlEntityStorageInterface::class);
     $entity_storage->expects($this->atLeastOnce())
       ->method('getTableMapping')
       ->willReturn($table_mapping);
@@ -452,13 +462,13 @@ public function testQueryWithGroupByForBaseField() {
         'title' => $field_storage,
       ]);
 
-    $table_mapping = $this->getMock('Drupal\Core\Entity\Sql\TableMappingInterface');
+    $table_mapping = $this->getMock(TableMappingInterface::class);
     $table_mapping
       ->expects($this->any())
       ->method('getFieldColumnName')
       ->with($field_storage, 'value')
       ->willReturn('title');
-    $entity_storage = $this->getMock('Drupal\Core\Entity\Sql\SqlEntityStorageInterface');
+    $entity_storage = $this->getMock(SqlEntityStorageInterface::class);
     $entity_storage->expects($this->any())
       ->method('getTableMapping')
       ->willReturn($table_mapping);
@@ -514,13 +524,13 @@ public function testQueryWithGroupByForConfigField() {
         'body' => $field_storage,
       ]);
 
-    $table_mapping = $this->getMock('Drupal\Core\Entity\Sql\TableMappingInterface');
+    $table_mapping = $this->getMock(TableMappingInterface::class);
     $table_mapping
       ->expects($this->any())
       ->method('getFieldColumnName')
       ->with($field_storage, 'value')
       ->willReturn('body_value');
-    $entity_storage = $this->getMock('Drupal\Core\Entity\Sql\SqlEntityStorageInterface');
+    $entity_storage = $this->getMock(SqlEntityStorageInterface::class);
     $entity_storage->expects($this->any())
       ->method('getTableMapping')
       ->willReturn($table_mapping);
@@ -582,13 +592,13 @@ public function testPrepareItemsByDelta(array $options, array $expected_values)
         'integer' => $field_storage,
       ]);
 
-    $table_mapping = $this->getMock('Drupal\Core\Entity\Sql\TableMappingInterface');
+    $table_mapping = $this->getMock(TableMappingInterface::class);
     $table_mapping
       ->expects($this->any())
       ->method('getFieldColumnName')
       ->with($field_storage, 'value')
       ->willReturn('integer_value');
-    $entity_storage = $this->getMock('Drupal\Core\Entity\Sql\SqlEntityStorageInterface');
+    $entity_storage = $this->getMock(SqlEntityStorageInterface::class);
     $entity_storage->expects($this->any())
       ->method('getTableMapping')
       ->willReturn($table_mapping);
@@ -639,7 +649,7 @@ public function providerTestPrepareItemsByDelta() {
    * @return \Drupal\Core\Field\FieldStorageDefinitionInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function getBaseFieldStorage() {
-    $title_storage = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $title_storage = $this->getMock(FieldStorageDefinitionInterface::class);
     $title_storage->expects($this->any())
       ->method('getColumns')
       ->willReturn(['value' => ['type' => 'varchar']]);
@@ -712,7 +722,7 @@ protected function setupLanguageRenderer(EntityField $handler, $definition) {
       ->willReturn($data);
     $this->container->set('views.views_data', $views_data);
 
-    $entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->any())
       ->method('id')
       ->willReturn($definition['entity_type']);
diff --git a/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
index 555c8a4..9a86578 100644
--- a/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\pager;
 
+use \Drupal\Core\Database\Query\Select;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Database\StatementInterface;
 
@@ -211,7 +212,7 @@ public function testExecuteCountQueryWithoutOffset() {
       ->method('fetchField')
       ->will($this->returnValue(3));
 
-    $query = $this->getMockBuilder('\Drupal\Core\Database\Query\Select')
+    $query = $this->getMockBuilder(Select::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -235,7 +236,7 @@ public function testExecuteCountQueryWithOffset() {
       ->method('fetchField')
       ->will($this->returnValue(3));
 
-    $query = $this->getMockBuilder('\Drupal\Core\Database\Query\Select')
+    $query = $this->getMockBuilder(Select::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php b/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
index 02a5ce6..85efff5 100644
--- a/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@@ -38,7 +38,7 @@ public function testGetCacheTags() {
 
     // Add a row with an entity.
     $row = new ResultRow();
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheTags()->willReturn(['entity_test:123']);
     $entity = $prophecy->reveal();
     $row->_entity = $entity;
@@ -48,16 +48,16 @@ public function testGetCacheTags() {
 
     // Add a row with an entity and a relationship entity.
     $row = new ResultRow();
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheTags()->willReturn(['entity_test:124']);
     $entity = $prophecy->reveal();
     $row->_entity = $entity;
 
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheTags()->willReturn(['entity_test:125']);
     $entity = $prophecy->reveal();
     $row->_relationship_entities[] = $entity;
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheTags()->willReturn(['entity_test:126']);
     $entity = $prophecy->reveal();
     $row->_relationship_entities[] = $entity;
@@ -83,7 +83,7 @@ public function testGetCacheMaxAge() {
 
     // Add a row with an entity.
     $row = new ResultRow();
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheMaxAge()->willReturn(10);
     $entity = $prophecy->reveal();
 
@@ -92,16 +92,16 @@ public function testGetCacheMaxAge() {
 
     // Add a row with an entity and a relationship entity.
     $row = new ResultRow();
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheMaxAge()->willReturn(20);
     $entity = $prophecy->reveal();
     $row->_entity = $entity;
 
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheMaxAge()->willReturn(30);
     $entity = $prophecy->reveal();
     $row->_relationship_entities[] = $entity;
-    $prophecy = $this->prophesize('Drupal\Core\Entity\EntityInterface');
+    $prophecy = $this->prophesize(EntityInterface::class);
     $prophecy->getCacheMaxAge()->willReturn(40);
     $entity = $prophecy->reveal();
     $row->_relationship_entities[] = $entity;
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
index 0900df6..2b15fb2 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\views\Unit\Plugin\views\field;
 
+use \Drupal\Core\Entity\EntityListBuilderInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\views\field\EntityOperations;
 use Drupal\views\ResultRow;
@@ -39,8 +43,8 @@ class EntityOperationsUnitTest extends UnitTestCase {
    * @covers ::__construct
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
 
     $configuration = [];
     $plugin_id = $this->randomMachineName();
@@ -49,7 +53,7 @@ protected function setUp() {
     ];
     $this->plugin = new EntityOperations($configuration, $plugin_id, $plugin_definition, $this->entityManager, $this->languageManager);
 
-    $redirect_service = $this->getMock('Drupal\Core\Routing\RedirectDestinationInterface');
+    $redirect_service = $this->getMock(RedirectDestinationInterface::class);
     $redirect_service->expects($this->any())
       ->method('getAsArray')
       ->willReturn(['destination' => 'foobar']);
@@ -98,7 +102,7 @@ public function testRenderWithDestination() {
         'title' => $this->randomMachineName(),
       ],
     ];
-    $list_builder = $this->getMock('\Drupal\Core\Entity\EntityListBuilderInterface');
+    $list_builder = $this->getMock(EntityListBuilderInterface::class);
     $list_builder->expects($this->once())
       ->method('getOperations')
       ->with($entity)
@@ -140,7 +144,7 @@ public function testRenderWithoutDestination() {
         'title' => $this->randomMachineName(),
       ],
     ];
-    $list_builder = $this->getMock('\Drupal\Core\Entity\EntityListBuilderInterface');
+    $list_builder = $this->getMock(EntityListBuilderInterface::class);
     $list_builder->expects($this->once())
       ->method('getOperations')
       ->with($entity)
diff --git a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
index 9242545..8a0602a 100644
--- a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\views\Unit\Routing;
 
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Routing\RouteMatch;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Routing\ViewPageController;
@@ -147,7 +148,7 @@ public function testHandleWithArgumentsOnOverriddenRouteWithUpcasting() {
     $request->attributes->set('view_id', 'test_page_view');
     $request->attributes->set('display_id', 'page_1');
     // Add the argument to the request.
-    $request->attributes->set('test_entity', $this->getMock('Drupal\Core\Entity\EntityInterface'));
+    $request->attributes->set('test_entity', $this->getMock(EntityInterface::class));
     $raw_variables = new ParameterBag(['test_entity' => 'example_id']);
     $request->attributes->set('_raw_variables', $raw_variables);
     $options = [
diff --git a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
index e7f52e7..3f38a72 100644
--- a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
+++ b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\views\Unit;
 
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\ViewExecutableFactory;
 use Symfony\Component\HttpFoundation\Request;
@@ -61,13 +63,13 @@ class ViewExecutableFactoryTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->user = $this->getMock(AccountInterface::class);
     $this->requestStack = new RequestStack();
     $this->view = $this->getMock('Drupal\views\ViewEntityInterface');
     $this->viewsData = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
     $this->viewExecutableFactory = new ViewExecutableFactory($this->user, $this->requestStack, $this->viewsData, $this->routeProvider);
   }
 
diff --git a/core/modules/views/tests/src/Unit/ViewExecutableTest.php b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
index f30a19d..430991b 100644
--- a/core/modules/views/tests/src/Unit/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
@@ -5,6 +5,8 @@
 use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Entity\View;
@@ -108,14 +110,14 @@ protected function setUp() {
     parent::setUp();
 
     $this->view = $this->getMock('Drupal\views\ViewEntityInterface');
-    $this->user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->user = $this->getMock(AccountInterface::class);
     $this->viewsData = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
     $this->displayHandler = $this->getMockBuilder('Drupal\views\Plugin\views\display\DisplayRouterInterface')
       ->disableOriginalConstructor()
       ->getMock();
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
     $this->displayHandlers = $this->getMockBuilder('Drupal\views\DisplayPluginCollection')
       ->disableOriginalConstructor()
       ->getMock();
diff --git a/core/modules/views/tests/src/Unit/ViewsDataTest.php b/core/modules/views/tests/src/Unit/ViewsDataTest.php
index a145538..d6fb599 100644
--- a/core/modules/views/tests/src/Unit/ViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsDataTest.php
@@ -2,7 +2,11 @@
 
 namespace Drupal\Tests\views\Unit;
 
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\ViewsData;
 use Drupal\views\Tests\ViewTestData;
@@ -59,15 +63,15 @@ class ViewsDataTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
-    $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
+    $this->cacheBackend = $this->getMock(CacheBackendInterface::class);
     $this->getContainerWithCacheTagsInvalidator($this->cacheTagsInvalidator);
 
     $configs = [];
     $configs['views.settings']['skip_cache'] = FALSE;
     $this->configFactory = $this->getConfigFactoryStub($configs);
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getCurrentLanguage')
       ->will($this->returnValue(new Language(['id' => 'en'])));
diff --git a/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php b/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
index c181b94..7baf6c6 100644
--- a/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\views\Unit;
 
+use Drupal\Component\Plugin\Factory\FactoryInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\ViewsHandlerManager;
 
@@ -46,8 +49,8 @@ protected function setUp() {
     $this->viewsData = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
-    $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $cache_backend = $this->getMock(CacheBackendInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->handlerManager = new ViewsHandlerManager('test', new \ArrayObject([]), $this->viewsData, $cache_backend, $this->moduleHandler);
   }
 
@@ -55,7 +58,7 @@ protected function setUp() {
    * Setups of the plugin factory.
    */
   protected function setupMockedFactory() {
-    $this->factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface');
+    $this->factory = $this->getMock(FactoryInterface::class);
 
     $reflection = new \ReflectionClass($this->handlerManager);
     $property = $reflection->getProperty('factory');
diff --git a/core/modules/views/tests/src/Unit/ViewsTest.php b/core/modules/views/tests/src/Unit/ViewsTest.php
index 00476c5..3176bc3 100644
--- a/core/modules/views/tests/src/Unit/ViewsTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsTest.php
@@ -2,12 +2,18 @@
 
 namespace Drupal\Tests\views\Unit;
 
+use Drupal\Component\Plugin\PluginManagerInterface;
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Views;
 use Drupal\views\Entity\View;
 use Drupal\views\ViewExecutableFactory;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
 
@@ -31,13 +37,13 @@ protected function setUp() {
     parent::setUp();
 
     $this->container = new ContainerBuilder();
-    $user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $user = $this->getMock(AccountInterface::class);
     $request_stack = new RequestStack();
     $request_stack->push(new Request());
     $views_data = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
     $this->container->set('views.executable', new ViewExecutableFactory($user, $request_stack, $views_data, $route_provider));
 
     \Drupal::setContainer($this->container);
@@ -51,7 +57,7 @@ protected function setUp() {
   public function testGetView() {
     $view = new View(['id' => 'test_view'], 'view');
 
-    $view_storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
+    $view_storage = $this->getMockBuilder(ConfigEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
     $view_storage->expects($this->once())
@@ -59,7 +65,7 @@ public function testGetView() {
       ->with('test_view')
       ->will($this->returnValue($view));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->once())
       ->method('getStorage')
       ->with('view')
@@ -134,7 +140,7 @@ public function testGetApplicableViews($applicable_type, $expected) {
       ],
     ], 'view');
 
-    $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $query = $this->getMock(QueryInterface::class);
     $query->expects($this->exactly(2))
       ->method('condition')
       ->willReturnSelf();
@@ -142,7 +148,7 @@ public function testGetApplicableViews($applicable_type, $expected) {
       ->method('execute')
       ->willReturn(['test_view_1', 'test_view_2', 'test_view_3']);
 
-    $view_storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
+    $view_storage = $this->getMockBuilder(ConfigEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
     $view_storage->expects($this->once())
@@ -172,7 +178,7 @@ public function testGetApplicableViews($applicable_type, $expected) {
       ],
     ];
 
-    $display_manager = $this->getMock('Drupal\Component\Plugin\PluginManagerInterface');
+    $display_manager = $this->getMock(PluginManagerInterface::class);
     $display_manager->expects($this->once())
       ->method('getDefinitions')
       ->willReturn($definitions);
diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
index 23cc7a8..8608f6a 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
@@ -7,8 +7,14 @@
 
 namespace Drupal\Tests\views_ui\Unit;
 
+use \Drupal\Core\Entity\EntityStorageInterface;
+use \Drupal\Core\State\StateInterface;
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Entity\View;
 use Drupal\views\ViewExecutableFactory;
@@ -29,7 +35,7 @@ class ViewListBuilderTest extends UnitTestCase {
    * @covers ::buildRow
    */
   public function testBuildRowEntityList() {
-    $storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
+    $storage = $this->getMockBuilder(ConfigEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
     $display_manager = $this->getMockBuilder('\Drupal\views\Plugin\ViewsPluginManager')
@@ -80,9 +86,9 @@ public function testBuildRowEntityList() {
       ['initDisplay'],
       [[], 'default', $display_manager->getDefinition('default')]
     );
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $state = $this->getMock('\Drupal\Core\State\StateInterface');
-    $menu_storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
+    $state = $this->getMock(StateInterface::class);
+    $menu_storage = $this->getMock(EntityStorageInterface::class);
     $page_display = $this->getMock('Drupal\views\Plugin\views\display\Page',
       ['initDisplay', 'getPath'],
       [[], 'default', $display_manager->getDefinition('page'), $route_provider, $state, $menu_storage]
@@ -134,13 +140,13 @@ public function testBuildRowEntityList() {
       ]));
 
     $container = new ContainerBuilder();
-    $user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $user = $this->getMock(AccountInterface::class);
     $request_stack = new RequestStack();
     $request_stack->push(new Request());
     $views_data = $this->getMockBuilder('Drupal\views\ViewsData')
       ->disableOriginalConstructor()
       ->getMock();
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
     $executable_factory = new ViewExecutableFactory($user, $request_stack, $views_data, $route_provider);
     $container->set('views.executable', $executable_factory);
     $container->set('plugin.manager.views.display', $display_manager);
@@ -148,7 +154,7 @@ public function testBuildRowEntityList() {
 
     // Setup a view list builder with a mocked buildOperations method,
     // because t() is called on there.
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $view_list_builder = new TestViewListBuilder($entity_type, $storage, $display_manager);
     $view_list_builder->setStringTranslation($this->getStringTranslationStub());
 
diff --git a/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php b/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
index f49b25a..628de92 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\Tests\views_ui\Unit;
 
+use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Entity\View;
 use Drupal\views_ui\ViewUI;
@@ -24,7 +26,7 @@ public function testEntityDecoration() {
     $method_args['enforceIsNew'] = [FALSE];
     $method_args['label'] = [LanguageInterface::LANGCODE_NOT_SPECIFIED];
 
-    $reflection = new \ReflectionClass('Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $reflection = new \ReflectionClass(ConfigEntityInterface::class);
     $interface_methods = [];
     foreach ($reflection->getMethods() as $reflection_method) {
       $interface_methods[] = $reflection_method->getName();
@@ -76,7 +78,7 @@ public function testIsLocked() {
       ->setConstructorArgs([$storage])
       ->getMock();
     $storage->set('executable', $executable);
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $account->expects($this->exactly(2))
       ->method('id')
       ->will($this->returnValue(1));
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index 3689ddd..75fed18 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -123,7 +123,7 @@ public function testClickLink() {
   }
 
   public function testError() {
-    $this->setExpectedException('\Exception', 'User notice: foo');
+    $this->setExpectedException(\Exception::class, 'User notice: foo');
     $this->drupalGet('test-error');
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php b/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
index df3a6e2..bdeb412 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Core\Cache\CacheFactory;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Lock\DatabaseLockBackend;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\Tests\Core\Cache\CacheCollectorHelper;
 use Symfony\Component\DependencyInjection\Reference;
@@ -21,13 +23,13 @@ public function register(ContainerBuilder $container) {
     parent::register($container);
     // Change container to database cache backends.
     $container
-      ->register('cache_factory', 'Drupal\Core\Cache\CacheFactory')
+      ->register('cache_factory', CacheFactory::class)
       ->addArgument(new Reference('settings'))
       ->addMethodCall('setContainer', [new Reference('service_container')]);
 
     // Change container to use database lock backends.
     $container
-      ->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend')
+      ->register('lock', DatabaseLockBackend::class)
       ->addArgument(new Reference('database'));
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
index 0fefc39..f49a541 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\KernelTests\Core\Cache;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheFactory;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\DependencyInjection\Reference;
@@ -28,7 +29,7 @@ public function register(ContainerBuilder $container) {
     parent::register($container);
     // Change container to database cache backends.
     $container
-      ->register('cache_factory', 'Drupal\Core\Cache\CacheFactory')
+      ->register('cache_factory', CacheFactory::class)
       ->addArgument(new Reference('settings'))
       ->addMethodCall('setContainer', [new Reference('service_container')]);
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
index 8129410..758741a 100644
--- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\KernelTests\Core\Command;
 
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Core\Cache\DatabaseBackendFactory;
 use Drupal\Core\Command\DbDumpApplication;
 use Drupal\Core\Config\DatabaseStorage;
 use Drupal\Core\Database\Database;
@@ -68,7 +69,7 @@ class DbDumpTest extends KernelTestBase {
    */
   public function register(ContainerBuilder $container) {
     parent::register($container);
-    $container->register('cache_factory', 'Drupal\Core\Cache\DatabaseBackendFactory')
+    $container->register('cache_factory', DatabaseBackendFactory::class)
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'));
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php b/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php
index 59470e6..f786782 100644
--- a/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalSetMessageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Common;
 
+use Drupal\Core\Render\Markup;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -16,7 +17,7 @@ class DrupalSetMessageTest extends KernelTestBase {
   public function testDrupalSetMessage() {
     drupal_set_message(t('A message: @foo', ['@foo' => 'bar']));
     $messages = drupal_get_messages();
-    $this->assertInstanceOf('Drupal\Core\Render\Markup', $messages['status'][0]);
+    $this->assertInstanceOf(Markup::class, $messages['status'][0]);
     $this->assertEquals('A message: bar', (string) $messages['status'][0]);
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index e2e02e1..2d41c26 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\Config;
 
+use \Drupal\Core\TypedData\DataDefinition;
+use \Drupal\Core\TypedData\MapDataDefinition;
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Config\InstallStorage;
 use Drupal\Core\Config\Schema\ConfigSchemaAlterException;
@@ -46,7 +48,7 @@ public function testSchemaMapping() {
     $expected['label'] = 'Undefined';
     $expected['class'] = Undefined::class;
     $expected['type'] = 'undefined';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
+    $expected['definition_class'] = DataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.');
 
@@ -67,7 +69,7 @@ public function testSchemaMapping() {
     $expected['mapping']['testitem'] = ['label' => 'Test item'];
     $expected['mapping']['testlist'] = ['label' => 'Test list'];
     $expected['type'] = 'config_schema_test.someschema';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with only some schema.');
 
@@ -78,7 +80,7 @@ public function testSchemaMapping() {
     $expected['label'] = 'Test item';
     $expected['class'] = Undefined::class;
     $expected['type'] = 'undefined';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
+    $expected['definition_class'] = DataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Automatic type detected for a scalar is undefined.');
     $definition = $config->get('testlist')->getDataDefinition()->toArray();
@@ -86,7 +88,7 @@ public function testSchemaMapping() {
     $expected['label'] = 'Test list';
     $expected['class'] = Undefined::class;
     $expected['type'] = 'undefined';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
+    $expected['definition_class'] = DataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Automatic type detected for a list is undefined.');
     $definition = $config->get('testnoschema')->getDataDefinition()->toArray();
@@ -94,7 +96,7 @@ public function testSchemaMapping() {
     $expected['label'] = 'Undefined';
     $expected['class'] = Undefined::class;
     $expected['type'] = 'undefined';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
+    $expected['definition_class'] = DataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Automatic type detected for an undefined integer is undefined.');
 
@@ -113,7 +115,7 @@ public function testSchemaMapping() {
     ];
     $expected['mapping']['_core']['type'] = '_core_config_info';
     $expected['type'] = 'system.maintenance';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected, 'Retrieved the right metadata for system.maintenance');
 
@@ -122,7 +124,7 @@ public function testSchemaMapping() {
     $expected = [];
     $expected['label'] = 'Ignore test';
     $expected['class'] = Mapping::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['mapping']['langcode'] = [
       'type' => 'string',
       'label' => 'Language code',
@@ -155,7 +157,7 @@ public function testSchemaMapping() {
     $expected['type'] = 'ignore';
     $expected['label'] = 'Irrelevant';
     $expected['class'] = Ignore::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
+    $expected['definition_class'] = DataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $this->assertEqual($definition, $expected);
     $definition = \Drupal::service('config.typed')->get('config_schema_test.ignore')->get('indescribable')->getDataDefinition()->toArray();
@@ -167,7 +169,7 @@ public function testSchemaMapping() {
     $expected = [];
     $expected['label'] = 'Image style';
     $expected['class'] = Mapping::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $expected['mapping']['name']['type'] = 'string';
     $expected['mapping']['uuid']['type'] = 'uuid';
@@ -201,7 +203,7 @@ public function testSchemaMapping() {
     $expected = [];
     $expected['label'] = 'Image scale';
     $expected['class'] = Mapping::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $expected['mapping']['width']['type'] = 'integer';
     $expected['mapping']['width']['label'] = 'Width';
@@ -229,7 +231,7 @@ public function testSchemaMapping() {
     $expected['type'] = 'config_test.dynamic.*.third_party.config_schema_test';
     $expected['label'] = 'Mapping';
     $expected['class'] = Mapping::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $expected['mapping'] = [
       'integer' => ['type' => 'integer'],
@@ -251,7 +253,7 @@ public function testSchemaMapping() {
     $expected['mapping']['testdescription']['type'] = 'text';
     $expected['mapping']['testdescription']['label'] = 'Description';
     $expected['type'] = 'config_schema_test.someschema.somemodule.*.*';
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
 
     $this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_schema_test.someschema.somemodule.section_one.subsection');
@@ -274,7 +276,7 @@ public function testSchemaMappingWithParents() {
       'type' => 'config_schema_test.someschema.with_parents.key_1',
       'label' => 'Test item nested one level',
       'class' => StringData::class,
-      'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
+      'definition_class' => DataDefinition::class,
       'unwrap_for_canonical_representation' => TRUE,
     ];
     $this->assertEqual($definition, $expected);
@@ -286,7 +288,7 @@ public function testSchemaMappingWithParents() {
       'type' => 'config_schema_test.someschema.with_parents.key_2',
       'label' => 'Test item nested two levels',
       'class' => StringData::class,
-      'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
+      'definition_class' => DataDefinition::class,
       'unwrap_for_canonical_representation' => TRUE,
     ];
     $this->assertEqual($definition, $expected);
@@ -298,7 +300,7 @@ public function testSchemaMappingWithParents() {
       'type' => 'config_schema_test.someschema.with_parents.key_3',
       'label' => 'Test item nested three levels',
       'class' => StringData::class,
-      'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
+      'definition_class' => DataDefinition::class,
       'unwrap_for_canonical_representation' => TRUE,
     ];
     $this->assertEqual($definition, $expected);
@@ -489,7 +491,7 @@ public function testSchemaFallback() {
     $expected = [];
     $expected['label'] = 'Schema wildcard fallback test';
     $expected['class'] = Mapping::class;
-    $expected['definition_class'] = '\Drupal\Core\TypedData\MapDataDefinition';
+    $expected['definition_class'] = MapDataDefinition::class;
     $expected['unwrap_for_canonical_representation'] = TRUE;
     $expected['mapping']['langcode']['type'] = 'string';
     $expected['mapping']['langcode']['label'] = 'Language code';
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
index 2366478..34d16dc 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Config\Storage;
 
+use Drupal\Core\Cache\DatabaseBackendFactory;
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Config\CachedStorage;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -86,7 +87,7 @@ protected function delete($name) {
   public function containerBuild(ContainerBuilder $container) {
     parent::containerBuild($container);
     // Use the regular database cache backend to aid testing.
-    $container->register('cache_factory', 'Drupal\Core\Cache\DatabaseBackendFactory')
+    $container->register('cache_factory', DatabaseBackendFactory::class)
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'));
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php b/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
index 16fd053..7a5e4d6 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
@@ -44,7 +44,7 @@ public function testGetPrefixInfo() {
       $property->setValue($db2_connection, $connection_info['default']);
 
       // For testing purposes, we also change the database info.
-      $reflection_class = new \ReflectionClass('Drupal\Core\Database\Database');
+      $reflection_class = new \ReflectionClass(Database::class);
       $property = $reflection_class->getProperty('databaseInfo');
       $property->setAccessible(TRUE);
       $info = $property->getValue();
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
index cd3ec4a..dfa8bd3 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\PagerSelectExtender;
 use Drupal\Core\Database\RowCountException;
 use Drupal\user\Entity\User;
 
@@ -206,7 +207,7 @@ public function testCountQuery() {
    */
   public function testHavingCountQuery() {
     $query = db_select('test')
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+      ->extend(PagerSelectExtender::class)
       ->groupBy('age')
       ->having('age + 1 > 0');
     $query->addField('test', 'age');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php b/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
index cab9138..fa43295 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\Database;
 
+use Drupal\Core\Database\Query\SelectExtender;
+
 /**
  * Tests the tagging capabilities of the Select builder.
  *
@@ -60,7 +62,7 @@ public function testHasAnyTag() {
    */
   public function testExtenderHasTag() {
     $query = db_select('test')
-      ->extend('Drupal\Core\Database\Query\SelectExtender');
+      ->extend(SelectExtender::class);
     $query->addField('test', 'name');
     $query->addField('test', 'age', 'age');
 
@@ -75,7 +77,7 @@ public function testExtenderHasTag() {
    */
   public function testExtenderHasAllTags() {
     $query = db_select('test')
-      ->extend('Drupal\Core\Database\Query\SelectExtender');
+      ->extend(SelectExtender::class);
     $query->addField('test', 'name');
     $query->addField('test', 'age', 'age');
 
@@ -91,7 +93,7 @@ public function testExtenderHasAllTags() {
    */
   public function testExtenderHasAnyTag() {
     $query = db_select('test')
-      ->extend('Drupal\Core\Database\Query\SelectExtender');
+      ->extend(SelectExtender::class);
     $query->addField('test', 'name');
     $query->addField('test', 'age', 'age');
 
diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
index deea2a9..e6e7fc0 100644
--- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\DrupalKernel;
 
+use Drupal\Core\Cache\DatabaseBackendFactory;
+use Drupal\Core\Cache\MemoryBackendFactory;
 use Drupal\Core\Site\Settings;
 use Drupal\KernelTests\KernelTestBase;
 
@@ -23,7 +25,7 @@ public function testServicesYml() {
     // A service provider class always has precedence over services.yml files.
     // KernelTestBase::buildContainer() swaps out many services with in-memory
     // implementations already, so those cannot be tested.
-    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), 'Drupal\Core\Cache\DatabaseBackendFactory');
+    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), DatabaseBackendFactory::class);
 
     $class = __CLASS__;
     $doc = <<<EOD
@@ -41,7 +43,7 @@ class: Drupal\Core\Cache\MemoryBackendFactory
     $this->container->get('kernel')->rebuildContainer();
 
     $this->assertTrue($this->container->has('site.service.yml'));
-    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), 'Drupal\Core\Cache\MemoryBackendFactory');
+    $this->assertIdentical(get_class($this->container->get('cache.backend.database')), MemoryBackendFactory::class);
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
index bf2a147..4159c98 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\KernelTests\Core\Entity;
 
 use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase;
+use Drupal\Core\Validation\ConstraintManager;
 
 /**
  * Tests the Entity Validation API.
@@ -99,7 +100,7 @@ public function testValidation() {
     foreach ($cached_discoveries as $cached_discovery) {
       $cached_discovery_classes[] = get_class($cached_discovery);
     }
-    $this->assertTrue(in_array('Drupal\Core\Validation\ConstraintManager', $cached_discovery_classes));
+    $this->assertTrue(in_array(ConstraintManager::class, $cached_discovery_classes));
 
     // All entity variations have to have the same results.
     foreach (entity_test_entity_types() as $entity_type) {
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
index 92612ae..4be428d 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
@@ -3,6 +3,7 @@
 namespace Drupal\KernelTests\Core\File;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\StreamWrapper\PrivateStream;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -51,7 +52,7 @@ protected function setUp() {
   public function register(ContainerBuilder $container) {
     parent::register($container);
 
-    $container->register('stream_wrapper.private', 'Drupal\Core\StreamWrapper\PrivateStream')
+    $container->register('stream_wrapper.private', PrivateStream::class)
       ->addTag('stream_wrapper', ['scheme' => 'private']);
 
     if (isset($this->scheme)) {
diff --git a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
index 6c18b66..f8148f0 100644
--- a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
@@ -51,7 +51,7 @@ public function testGetClassName() {
     // Check the dummy scheme.
     $this->assertEqual($this->classname, \Drupal::service('stream_wrapper_manager')->getClass($this->scheme), 'Got correct class name for dummy scheme.');
     // Check core's scheme.
-    $this->assertEqual('Drupal\Core\StreamWrapper\PublicStream', \Drupal::service('stream_wrapper_manager')->getClass('public'), 'Got correct class name for public scheme.');
+    $this->assertEqual(PublicStream::class, \Drupal::service('stream_wrapper_manager')->getClass('public'), 'Got correct class name for public scheme.');
   }
 
   /**
@@ -62,7 +62,7 @@ public function testGetInstanceByScheme() {
     $this->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy scheme.');
 
     $instance = \Drupal::service('stream_wrapper_manager')->getViaScheme('public');
-    $this->assertEqual('Drupal\Core\StreamWrapper\PublicStream', get_class($instance), 'Got correct class type for public scheme.');
+    $this->assertEqual(PublicStream::class, get_class($instance), 'Got correct class type for public scheme.');
   }
 
   /**
@@ -75,7 +75,7 @@ public function testUriFunctions() {
     $this->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy URI.');
 
     $instance = \Drupal::service('stream_wrapper_manager')->getViaUri('public://foo');
-    $this->assertEqual('Drupal\Core\StreamWrapper\PublicStream', get_class($instance), 'Got correct class type for public URI.');
+    $this->assertEqual(PublicStream::class, get_class($instance), 'Got correct class type for public URI.');
 
     // Test file_uri_target().
     $this->assertEqual(file_uri_target('public://foo/bar.txt'), 'foo/bar.txt', 'Got a valid stream target from public://foo/bar.txt.');
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
index f0f7642..6289715 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\KeyValueStore\KeyValueFactory;
+use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 
 /**
  * Tests the key-value memory storage.
@@ -18,7 +19,7 @@ class MemoryStorageTest extends StorageTestBase {
   public function register(ContainerBuilder $container) {
     parent::register($container);
 
-    $container->register('keyvalue.memory', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory');
+    $container->register('keyvalue.memory', KeyValueMemoryFactory::class);
     $parameter[KeyValueFactory::DEFAULT_SETTING] = 'keyvalue.memory';
     $container->setParameter('factory.keyvalue', $parameter);
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
index 9003713..b3c54f8 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Plugin\Discovery;
 
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 
 /**
@@ -78,7 +79,7 @@ protected function setUp() {
     $namespaces = new \ArrayObject(['Drupal\plugin_test' => $base_directory, 'Drupal\plugin_test_extended' => $base_directory2]);
 
     $annotation_namespaces = ['Drupal\plugin_test\Plugin\Annotation', 'Drupal\plugin_test_extended\Plugin\Annotation'];
-    $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/fruit', $namespaces, 'Drupal\Component\Annotation\Plugin', $annotation_namespaces);
+    $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/fruit', $namespaces, Plugin::class, $annotation_namespaces);
     $this->emptyDiscovery = new AnnotatedClassDiscovery('Plugin/non_existing_module/non_existing_plugin_type', $namespaces);
   }
 
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
index 1428fde..6755df7 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
@@ -11,6 +11,7 @@
 use Symfony\Component\Routing\RouteCollection;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Routing\MatcherDumper;
+use Drupal\Core\Routing\RouteCompiler;
 use Drupal\Tests\Core\Routing\RoutingFixtures;
 
 /**
@@ -48,7 +49,7 @@ public function testCreate() {
     $connection = Database::getConnection();
     $dumper = new MatcherDumper($connection, $this->state);
 
-    $class_name = 'Drupal\Core\Routing\MatcherDumper';
+    $class_name = MatcherDumper::class;
     $this->assertTrue($dumper instanceof $class_name, 'Dumper created successfully');
   }
 
@@ -117,7 +118,7 @@ public function testDump() {
     $dumper = new MatcherDumper($connection, $this->state, 'test_routes');
 
     $route = new Route('/test/{my}/path');
-    $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
+    $route->setOption('compiler_class', RouteCompiler::class);
     $collection = new RouteCollection();
     $collection->add('test_route', $route);
 
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
index 61f6475..2af5d50 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Extension\ExtensionNameLengthException;
+use Drupal\Core\Routing\NullMatcherDumper;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -28,7 +29,7 @@ public function register(ContainerBuilder $container) {
     // Some test methods involve ModuleHandler operations, which attempt to
     // rebuild and dump routes.
     $container
-      ->register('router.dumper', 'Drupal\Core\Routing\NullMatcherDumper');
+      ->register('router.dumper', NullMatcherDumper::class);
   }
 
   protected function setUp() {
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 6a35f15..b65aa55 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -2,19 +2,27 @@
 
 namespace Drupal\KernelTests;
 
+use \Drupal\Component\PhpStorage\FileStorage;
+use Drupal\Component\Discovery\YamlDiscovery;
 use Drupal\Component\FileCache\ApcuFileCacheBackend;
 use Drupal\Component\FileCache\FileCache;
 use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Core\Cache\MemoryBackendFactory;
 use Drupal\Core\Config\Development\ConfigSchemaChecker;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
+use Drupal\Core\DependencyInjection\YamlFileLoader;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
 use Drupal\Core\Extension\ExtensionDiscovery;
+use Drupal\Core\Extension\InfoParser;
+use Drupal\Core\Flood\MemoryBackend;
+use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Lock\NullLockBackend;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\Test\TestDatabase;
 use Drupal\simpletest\AssertContentTrait;
@@ -93,14 +101,14 @@
    */
   protected $backupStaticAttributesBlacklist = [
     // Ignore static discovery/parser caches to speed up tests.
-    'Drupal\Component\Discovery\YamlDiscovery' => ['parsedFiles'],
-    'Drupal\Core\DependencyInjection\YamlFileLoader' => ['yaml'],
-    'Drupal\Core\Extension\ExtensionDiscovery' => ['files'],
-    'Drupal\Core\Extension\InfoParser' => ['parsedInfos'],
+    YamlDiscovery::class => ['parsedFiles'],
+    YamlFileLoader::class => ['yaml'],
+    ExtensionDiscovery::class => ['files'],
+    InfoParser::class => ['parsedInfos'],
     // Drupal::$container cannot be serialized.
     'Drupal' => ['container'],
     // Settings cannot be serialized.
-    'Drupal\Core\Site\Settings' => ['instance'],
+    Settings::class => ['instance'],
   ];
 
   /**
@@ -385,7 +393,7 @@ private function bootKernel() {
 
     $settings = Settings::getAll();
     $settings['php_storage']['default'] = [
-      'class' => '\Drupal\Component\PhpStorage\FileStorage',
+      'class' => FileStorage::class,
     ];
     new Settings($settings);
 
@@ -523,14 +531,14 @@ public function register(ContainerBuilder $container) {
     $this->container = $container;
 
     $container
-      ->register('flood', 'Drupal\Core\Flood\MemoryBackend')
+      ->register('flood', MemoryBackend::class)
       ->addArgument(new Reference('request_stack'));
     $container
-      ->register('lock', 'Drupal\Core\Lock\NullLockBackend');
+      ->register('lock', NullLockBackend::class);
     $container
-      ->register('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory');
+      ->register('cache_factory', MemoryBackendFactory::class);
     $container
-      ->register('keyvalue.memory', 'Drupal\Core\KeyValueStore\KeyValueMemoryFactory')
+      ->register('keyvalue.memory', KeyValueMemoryFactory::class)
       // Must persist container rebuilds, or all data would vanish otherwise.
       ->addTag('persist');
     $container
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
index f78304b..f3a4bec 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Component\DependencyInjection;
 
+use \Drupal\Component\DependencyInjection\Container;
 use Drupal\Component\Utility\Crypt;
 use PHPUnit\Framework\TestCase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -57,7 +58,7 @@ class ContainerTest extends TestCase {
    */
   protected function setUp() {
     $this->machineFormat = TRUE;
-    $this->containerClass = '\Drupal\Component\DependencyInjection\Container';
+    $this->containerClass = Container::class;
     $this->containerDefinition = $this->getMockContainerDefinition();
     $this->container = new $this->containerClass($this->containerDefinition);
   }
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
index 038e018..ab875e0 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
@@ -7,7 +7,9 @@
 
 namespace Drupal\Tests\Component\DependencyInjection\Dumper {
 
-  use Drupal\Component\Utility\Crypt;
+  use \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper;
+use \Symfony\Component\DependencyInjection\ContainerBuilder;
+use Drupal\Component\Utility\Crypt;
   use PHPUnit\Framework\TestCase;
   use Symfony\Component\DependencyInjection\Definition;
   use Symfony\Component\DependencyInjection\Reference;
@@ -50,7 +52,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
      *
      * @var string
      */
-    protected $dumperClass = '\Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper';
+    protected $dumperClass = OptimizedPhpArrayDumper::class;
 
     /**
      * The dumper instance.
@@ -64,7 +66,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
      */
     protected function setUp() {
       // Setup a mock container builder.
-      $this->containerBuilder = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerBuilder');
+      $this->containerBuilder = $this->prophesize(ContainerBuilder::class);
       $this->containerBuilder->getAliases()->willReturn([]);
       $this->containerBuilder->getParameterBag()->willReturn(new ParameterBag());
       $this->containerBuilder->getDefinitions()->willReturn(NULL);
@@ -395,7 +397,7 @@ public function getDefinitionsDataProvider() {
       ];
 
       foreach ($service_definitions as $service_definition) {
-        $definition = $this->prophesize('\Symfony\Component\DependencyInjection\Definition');
+        $definition = $this->prophesize(\Symfony\Component\DependencyInjection\Definition::class);
         $definition->getClass()->willReturn($service_definition['class']);
         $definition->isPublic()->willReturn($service_definition['public']);
         $definition->getFile()->willReturn($service_definition['file']);
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php
index c107c1b..686d82c 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Component\DependencyInjection\Dumper;
 
+use \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -15,7 +16,7 @@ class PhpArrayDumperTest extends OptimizedPhpArrayDumperTest {
    */
   protected function setUp() {
     $this->machineFormat = FALSE;
-    $this->dumperClass = '\Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper';
+    $this->dumperClass = PhpArrayDumper::class;
     parent::setUp();
   }
 
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php
index 5baab11..be47cdd 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Component\DependencyInjection;
 
+use \Drupal\Component\DependencyInjection\PhpArrayContainer;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -15,7 +16,7 @@ class PhpArrayContainerTest extends ContainerTest {
    */
   protected function setUp() {
     $this->machineFormat = FALSE;
-    $this->containerClass = '\Drupal\Component\DependencyInjection\PhpArrayContainer';
+    $this->containerClass = PhpArrayContainer::class;
     $this->containerDefinition = $this->getMockContainerDefinition();
     $this->container = new $this->containerClass($this->containerDefinition);
   }
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
index 577241d..bf96205 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Component\PhpStorage;
 
+use Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage;
+
 /**
  * Tests the MTimeProtectedFastFileStorage implementation.
  *
@@ -24,6 +26,6 @@ class MTimeProtectedFastFileStorageTest extends MTimeProtectedFileStorageBase {
   /**
    * The PHP storage class to test.
    */
-  protected $storageClass = 'Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage';
+  protected $storageClass = MTimeProtectedFastFileStorage::class;
 
 }
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
index bc88c33..d5bc9f7 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Component\PhpStorage;
 
+use Drupal\Component\PhpStorage\MTimeProtectedFileStorage;
+
 /**
  * Tests the MTimeProtectedFileStorage implementation.
  *
@@ -23,6 +25,6 @@ class MTimeProtectedFileStorageTest extends MTimeProtectedFileStorageBase {
   /**
    * The PHP storage class to test.
    */
-  protected $storageClass = 'Drupal\Component\PhpStorage\MTimeProtectedFileStorage';
+  protected $storageClass = MTimeProtectedFileStorage::class;
 
 }
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php b/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
index f320c55..397c251 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Component\Plugin\Context;
 
 use Drupal\Component\Plugin\Context\Context;
+use Drupal\Component\Plugin\Context\ContextDefinitionInterface;
+use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -28,7 +30,7 @@ public function providerGetContextValue() {
    */
   public function testGetContextValue($expected, $context_value, $is_required, $data_type) {
     // Mock a Context object.
-    $mock_context = $this->getMockBuilder('Drupal\Component\Plugin\Context\Context')
+    $mock_context = $this->getMockBuilder(Context::class)
       ->disableOriginalConstructor()
       ->setMethods(['getContextDefinition'])
       ->getMock();
@@ -48,7 +50,7 @@ public function testGetContextValue($expected, $context_value, $is_required, $da
     // throwing an exception if the definition requires it.
     else {
       // Create a mock definition.
-      $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface')
+      $mock_definition = $this->getMockBuilder(ContextDefinitionInterface::class)
         ->setMethods(['isRequired', 'getDataType'])
         ->getMockForAbstractClass();
 
@@ -72,7 +74,7 @@ public function testGetContextValue($expected, $context_value, $is_required, $da
       // Set expectation for exception.
       if ($is_required) {
         $this->setExpectedException(
-          'Drupal\Component\Plugin\Exception\ContextException',
+          ContextException::class,
           sprintf("The %s context is required and not present.", $data_type)
         );
       }
@@ -86,7 +88,7 @@ public function testGetContextValue($expected, $context_value, $is_required, $da
    * @covers ::getContextValue
    */
   public function testDefaultValue() {
-    $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface')
+    $mock_definition = $this->getMockBuilder(ContextDefinitionInterface::class)
       ->setMethods(['getDefaultValue'])
       ->getMockForAbstractClass();
 
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
index 0f112fb..5311b85 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Component\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -34,7 +35,7 @@ public function providerGetDefinition() {
    */
   public function testGetDefinition($expected, $cached_definitions, $get_definitions, $plugin_id) {
     // Mock a DiscoveryCachedTrait.
-    $trait = $this->getMockForTrait('Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait');
+    $trait = $this->getMockForTrait(DiscoveryCachedTrait::class);
     $reflection_definitions = new \ReflectionProperty($trait, 'definitions');
     $reflection_definitions->setAccessible(TRUE);
     // getDefinition() needs the ::$definitions property to be set in one of two
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
index b0f58c9..54d1f83 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Component\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryTrait;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Tests\UnitTestCase;
 
@@ -32,7 +33,7 @@ public function providerDoGetDefinition() {
    */
   public function testDoGetDefinition($expected, $definitions, $plugin_id) {
     // Mock the trait.
-    $trait = $this->getMockForTrait('Drupal\Component\Plugin\Discovery\DiscoveryTrait');
+    $trait = $this->getMockForTrait(DiscoveryTrait::class);
     // Un-protect the method using reflection.
     $method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
     $method_ref->setAccessible(TRUE);
@@ -64,7 +65,7 @@ public function providerDoGetDefinitionException() {
    */
   public function testDoGetDefinitionException($expected, $definitions, $plugin_id) {
     // Mock the trait.
-    $trait = $this->getMockForTrait('Drupal\Component\Plugin\Discovery\DiscoveryTrait');
+    $trait = $this->getMockForTrait(DiscoveryTrait::class);
     // Un-protect the method using reflection.
     $method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
     $method_ref->setAccessible(TRUE);
@@ -81,7 +82,7 @@ public function testGetDefinition($expected, $definitions, $plugin_id) {
     // Since getDefinition is a wrapper around doGetDefinition(), we can re-use
     // its data provider. We just have to tell abstract method getDefinitions()
     // to use the $definitions array.
-    $trait = $this->getMockForTrait('Drupal\Component\Plugin\Discovery\DiscoveryTrait');
+    $trait = $this->getMockForTrait(DiscoveryTrait::class);
     $trait->expects($this->once())
       ->method('getDefinitions')
       ->willReturn($definitions);
@@ -101,7 +102,7 @@ public function testGetDefinitionException($expected, $definitions, $plugin_id)
     // Since getDefinition is a wrapper around doGetDefinition(), we can re-use
     // its data provider. We just have to tell abstract method getDefinitions()
     // to use the $definitions array.
-    $trait = $this->getMockForTrait('Drupal\Component\Plugin\Discovery\DiscoveryTrait');
+    $trait = $this->getMockForTrait(DiscoveryTrait::class);
     $trait->expects($this->once())
       ->method('getDefinitions')
       ->willReturn($definitions);
@@ -129,7 +130,7 @@ public function providerHasDefinition() {
    * @dataProvider providerHasDefinition
    */
   public function testHasDefinition($expected, $plugin_id) {
-    $trait = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryTrait')
+    $trait = $this->getMockBuilder(DiscoveryTrait::class)
       ->setMethods(['getDefinition'])
       ->getMockForTrait();
     // Set up our mocked getDefinition() to return TRUE for 'valid' and FALSE
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
index 1828d73..516e9ae 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\Component\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
+use Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator;
+use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -60,7 +63,7 @@ public function providerGetDefinition() {
    */
   public function testGetDefinition($expected, $has_register_definitions, $exception_on_invalid, $definitions, $base_plugin_id) {
     // Mock our StaticDiscoveryDecorator.
-    $mock_decorator = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator')
+    $mock_decorator = $this->getMockBuilder(StaticDiscoveryDecorator::class)
       ->disableOriginalConstructor()
       ->setMethods(['registeredDefintionCallback'])
       ->getMock();
@@ -86,7 +89,7 @@ public function testGetDefinition($expected, $has_register_definitions, $excepti
     $ref_definitions->setValue($mock_decorator, []);
 
     // Mock a decorated object.
-    $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface')
+    $mock_decorated = $this->getMockBuilder(DiscoveryInterface::class)
       ->setMethods(['getDefinitions'])
       ->getMockForAbstractClass();
     // Return our definitions from getDefinitions().
@@ -100,7 +103,7 @@ public function testGetDefinition($expected, $has_register_definitions, $excepti
     $ref_decorated->setValue($mock_decorator, $mock_decorated);
 
     if ($exception_on_invalid) {
-      $this->setExpectedException('Drupal\Component\Plugin\Exception\PluginNotFoundException');
+      $this->setExpectedException(PluginNotFoundException::class);
     }
 
     // Exercise getDefinition(). It calls parent::getDefinition().
@@ -130,7 +133,7 @@ public function providerGetDefinitions() {
    */
   public function testGetDefinitions($has_register_definitions, $definitions) {
     // Mock our StaticDiscoveryDecorator.
-    $mock_decorator = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator')
+    $mock_decorator = $this->getMockBuilder(StaticDiscoveryDecorator::class)
       ->disableOriginalConstructor()
       ->setMethods(['registeredDefintionCallback'])
       ->getMock();
@@ -156,7 +159,7 @@ public function testGetDefinitions($has_register_definitions, $definitions) {
     $ref_definitions->setValue($mock_decorator, []);
 
     // Mock a decorated object.
-    $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface')
+    $mock_decorated = $this->getMockBuilder(DiscoveryInterface::class)
       ->setMethods(['getDefinitions'])
       ->getMockForAbstractClass();
     // Our mocked method will return any arguments sent to it.
@@ -198,7 +201,7 @@ public function providerCall() {
    */
   public function testCall($method, $args) {
     // Mock a decorated object.
-    $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface')
+    $mock_decorated = $this->getMockBuilder(DiscoveryInterface::class)
       ->setMethods([$method])
       ->getMockForAbstractClass();
     // Our mocked method will return any arguments sent to it.
@@ -211,7 +214,7 @@ function () {
       );
 
     // Create a mock decorator.
-    $mock_decorator = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator')
+    $mock_decorator = $this->getMockBuilder(StaticDiscoveryDecorator::class)
       ->disableOriginalConstructor()
       ->getMock();
     // Poke the decorated object into our decorator.
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
index c6a0adf..fd4d96b 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
@@ -9,6 +9,7 @@
 
 namespace Drupal\Tests\Component\Plugin\Factory;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Component\Plugin\Factory\ReflectionFactory;
 use Drupal\Tests\UnitTestCase;
 
@@ -87,7 +88,7 @@ public function providerGetInstanceArguments() {
    */
   public function testCreateInstance($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) {
     // Create a mock DiscoveryInterface which can return our plugin definition.
-    $mock_discovery = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface')
+    $mock_discovery = $this->getMockBuilder(DiscoveryInterface::class)
       ->setMethods(['getDefinition', 'getDefinitions', 'hasDefinition'])
       ->getMock();
     $mock_discovery->expects($this->never())->method('getDefinitions');
@@ -111,7 +112,7 @@ public function testCreateInstance($expected, $reflector_name, $plugin_id, $plug
    * @dataProvider providerGetInstanceArguments
    */
   public function testGetInstanceArguments($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) {
-    $reflection_factory = $this->getMockBuilder('Drupal\Component\Plugin\Factory\ReflectionFactory')
+    $reflection_factory = $this->getMockBuilder(ReflectionFactory::class)
       ->disableOriginalConstructor()
       ->getMock();
     $get_instance_arguments_ref = new \ReflectionMethod($reflection_factory, 'getInstanceArguments');
@@ -123,7 +124,7 @@ public function testGetInstanceArguments($expected, $reflector_name, $plugin_id,
     // us to use one data set for this test method as well as
     // testCreateInstance().
     if ($plugin_id == 'arguments_no_constructor') {
-      $this->setExpectedException('\ReflectionException');
+      $this->setExpectedException(\ReflectionException::class);
     }
 
     // Finally invoke getInstanceArguments() on our mocked factory.
diff --git a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
index 0ef8451..6a9f00f 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Component\Plugin;
 
+use Drupal\Component\Plugin\PluginBase;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -15,7 +16,7 @@ class PluginBaseTest extends UnitTestCase {
    * @covers ::getPluginId
    */
   public function testGetPluginId($plugin_id, $expected) {
-    $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
+    $plugin_base = $this->getMockForAbstractClass(PluginBase::class, [
       [],
       $plugin_id,
       [],
@@ -42,7 +43,7 @@ public function providerTestGetPluginId() {
    */
   public function testGetBaseId($plugin_id, $expected) {
     /** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit_Framework_MockObject_MockObject $plugin_base */
-    $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
+    $plugin_base = $this->getMockForAbstractClass(PluginBase::class, [
       [],
       $plugin_id,
       [],
@@ -70,7 +71,7 @@ public function providerTestGetBaseId() {
    */
   public function testGetDerivativeId($plugin_id = NULL, $expected = NULL) {
     /** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit_Framework_MockObject_MockObject $plugin_base */
-    $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
+    $plugin_base = $this->getMockForAbstractClass(PluginBase::class, [
       [],
       $plugin_id,
       [],
@@ -95,7 +96,7 @@ public function providerTestGetDerivativeId() {
    * @covers ::getPluginDefinition
    */
   public function testGetPluginDefinition() {
-    $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
+    $plugin_base = $this->getMockForAbstractClass(PluginBase::class, [
       [],
       'plugin_id',
       ['value', ['key' => 'value']],
diff --git a/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
index 24a7b08..a32104a 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\Tests\Component\Plugin;
 
+use Drupal\Component\Plugin\PluginManagerBase;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
+use Drupal\Component\Plugin\Factory\FactoryInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -31,7 +33,7 @@ public function createInstanceCallback() {
    * Generates a mocked FactoryInterface object with known properties.
    */
   public function getMockFactoryInterface($expects_count) {
-    $mock_factory = $this->getMockBuilder('Drupal\Component\Plugin\Factory\FactoryInterface')
+    $mock_factory = $this->getMockBuilder(FactoryInterface::class)
       ->setMethods(['createInstance'])
       ->getMockForAbstractClass();
     $mock_factory->expects($this->exactly($expects_count))
@@ -46,7 +48,7 @@ public function getMockFactoryInterface($expects_count) {
    * @covers ::createInstance
    */
   public function testCreateInstance() {
-    $manager = $this->getMockBuilder('Drupal\Component\Plugin\PluginManagerBase')
+    $manager = $this->getMockBuilder(PluginManagerBase::class)
       ->getMockForAbstractClass();
     // PluginManagerBase::createInstance() looks for a factory object and then
     // calls createInstance() on it. So we have to mock a factory object.
diff --git a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
index 4628342..e863c56 100644
--- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
@@ -22,7 +22,7 @@ class HtmlTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $property = new \ReflectionProperty('Drupal\Component\Utility\Html', 'seenIdsInit');
+    $property = new \ReflectionProperty(Html::class, 'seenIdsInit');
     $property->setAccessible(TRUE);
     $property->setValue(NULL);
   }
diff --git a/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php b/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
index 0a7fc77..67538a0 100644
--- a/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
@@ -37,7 +37,7 @@ protected function tearDown() {
    * @covers ::isSafe
    */
   public function testIsSafe() {
-    $safe_string = $this->getMock('\Drupal\Component\Render\MarkupInterface');
+    $safe_string = $this->getMock(\Drupal\Component\Render\MarkupInterface::class);
     $this->assertTrue(SafeMarkup::isSafe($safe_string));
     $string_object = new SafeMarkupTestString('test');
     $this->assertFalse(SafeMarkup::isSafe($string_object));
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
index 231f809..c073c88 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
@@ -7,14 +7,19 @@
 
 namespace Drupal\Tests\Core\Access;
 
+use Drupal\Component\Utility\ArgumentsResolverInterface;
+use Drupal\Core\Access\AccessArgumentsResolverFactoryInterface;
 use Drupal\Core\Access\AccessCheckInterface;
 use Drupal\Core\Access\AccessException;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Access\CheckProvider;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Routing\RouteMatch;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\Access\AccessManager;
 use Drupal\Core\Access\DefaultAccessCheck;
+use Drupal\Core\ParamConverter\ParamConverterManagerInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\router_test\Access\DefinedTestAccessCheck;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -105,7 +110,7 @@ protected function setUp() {
     $this->routeCollection->add('test_route_3', new Route('/test-route-3', [], ['_access' => 'FALSE']));
     $this->routeCollection->add('test_route_4', new Route('/test-route-4/{value}', [], ['_access' => 'TRUE']));
 
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
     $map = [];
     foreach ($this->routeCollection->all() as $name => $route) {
       $map[] = [$name, [], $route];
@@ -121,11 +126,11 @@ protected function setUp() {
     $map[] = ['test_route_3', [], '/test-route-3'];
     $map[] = ['test_route_4', ['value' => 'example'], '/test-route-4/example'];
 
-    $this->paramConverter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface');
+    $this->paramConverter = $this->getMock(ParamConverterManagerInterface::class);
 
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->currentUser = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->argumentsResolverFactory = $this->getMock('Drupal\Core\Access\AccessArgumentsResolverFactoryInterface');
+    $this->account = $this->getMock(AccountInterface::class);
+    $this->currentUser = $this->getMock(AccountInterface::class);
+    $this->argumentsResolverFactory = $this->getMock(AccessArgumentsResolverFactoryInterface::class);
     $this->checkProvider = new CheckProvider();
     $this->checkProvider->setContainer($this->container);
 
@@ -369,7 +374,7 @@ public function testCheckNamedRouteWithUpcastedValues() {
     $route = new Route('/test-route-1/{value}', [], ['_test_access' => 'TRUE']);
     $this->routeCollection->add('test_route_1', $route);
 
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
     $this->routeProvider->expects($this->any())
       ->method('getRouteByName')
       ->with('test_route_1', ['value' => 'example'])
@@ -378,7 +383,7 @@ public function testCheckNamedRouteWithUpcastedValues() {
     $map = [];
     $map[] = ['test_route_1', ['value' => 'example'], '/test-route-1/example'];
 
-    $this->paramConverter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface');
+    $this->paramConverter = $this->getMock(ParamConverterManagerInterface::class);
     $this->paramConverter->expects($this->atLeastOnce())
       ->method('convert')
       ->with(['value' => 'example', RouteObjectInterface::ROUTE_NAME => 'test_route_1', RouteObjectInterface::ROUTE_OBJECT => $route])
@@ -418,7 +423,7 @@ public function testCheckNamedRouteWithDefaultValue() {
     $route = new Route('/test-route-1/{value}', ['value' => 'example'], ['_test_access' => 'TRUE']);
     $this->routeCollection->add('test_route_1', $route);
 
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
     $this->routeProvider->expects($this->any())
       ->method('getRouteByName')
       ->with('test_route_1', [])
@@ -427,7 +432,7 @@ public function testCheckNamedRouteWithDefaultValue() {
     $map = [];
     $map[] = ['test_route_1', ['value' => 'example'], '/test-route-1/example'];
 
-    $this->paramConverter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface');
+    $this->paramConverter = $this->getMock(ParamConverterManagerInterface::class);
     $this->paramConverter->expects($this->atLeastOnce())
       ->method('convert')
       ->with(['value' => 'example', RouteObjectInterface::ROUTE_NAME => 'test_route_1', RouteObjectInterface::ROUTE_OBJECT => $route])
@@ -477,7 +482,7 @@ public function testCheckNamedRouteWithNonExistingRoute() {
    * @dataProvider providerCheckException
    */
   public function testCheckException($return_value) {
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
 
     // Setup a test route for each access configuration.
     $requirements = [
@@ -494,7 +499,7 @@ public function testCheckException($return_value) {
       ->method('getRouteByName')
       ->will($this->returnValue($route));
 
-    $this->paramConverter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface');
+    $this->paramConverter = $this->getMock(ParamConverterManagerInterface::class);
     $this->paramConverter->expects($this->any())
       ->method('convert')
       ->will($this->returnValue([]));
@@ -551,7 +556,7 @@ protected function setupAccessArgumentsResolverFactory($constraint = NULL) {
     return $this->argumentsResolverFactory->expects($constraint)
       ->method('getArgumentsResolver')
       ->will($this->returnCallback(function ($route_match, $account) {
-        $resolver = $this->getMock('Drupal\Component\Utility\ArgumentsResolverInterface');
+        $resolver = $this->getMock(ArgumentsResolverInterface::class);
         $resolver->expects($this->any())
           ->method('getArguments')
           ->will($this->returnCallback(function ($callable) use ($route_match) {
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index 647da61..97a349f 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -7,12 +7,14 @@
 
 namespace Drupal\Tests\Core\Access;
 
+use \Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Access\AccessResultInterface;
 use Drupal\Core\Access\AccessResultNeutral;
 use Drupal\Core\Access\AccessResultReasonInterface;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableDependencyInterface;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 
@@ -35,7 +37,7 @@ class AccessResultTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->cacheContextsManager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $this->cacheContextsManager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -177,7 +179,7 @@ public function testAndIf() {
     $neutral = AccessResult::neutral('neutral message');
     $allowed = AccessResult::allowed();
     $forbidden = AccessResult::forbidden('forbidden message');
-    $unused_access_result_due_to_lazy_evaluation = $this->getMock('\Drupal\Core\Access\AccessResultInterface');
+    $unused_access_result_due_to_lazy_evaluation = $this->getMock(\Drupal\Core\Access\AccessResultInterface::class);
     $unused_access_result_due_to_lazy_evaluation->expects($this->never())
       ->method($this->anything());
 
@@ -268,7 +270,7 @@ public function testOrIf() {
     $neutral = AccessResult::neutral('neutral message');
     $allowed = AccessResult::allowed();
     $forbidden = AccessResult::forbidden('forbidden message');
-    $unused_access_result_due_to_lazy_evaluation = $this->getMock('\Drupal\Core\Access\AccessResultInterface');
+    $unused_access_result_due_to_lazy_evaluation = $this->getMock(\Drupal\Core\Access\AccessResultInterface::class);
     $unused_access_result_due_to_lazy_evaluation->expects($this->never())
       ->method($this->anything());
 
@@ -424,7 +426,7 @@ public function testCacheContexts() {
     $this->assertEquals($a, $c);
 
     // ::allowIfHasPermission and ::allowedIfHasPermission convenience methods.
-    $account = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $account->expects($this->any())
       ->method('hasPermission')
       ->with('may herd llamas')
@@ -895,7 +897,7 @@ public function testOrIfCacheabilityMerging() {
    *   The expected access check result.
    */
   public function testAllowedIfHasPermissions($permissions, $conjunction, AccessResult $expected_access) {
-    $account = $this->getMock('\Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $account->expects($this->any())
       ->method('hasPermission')
       ->willReturnMap([
diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
index edbbfba..14c815e 100644
--- a/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
@@ -6,6 +6,8 @@
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Route;
 use Drupal\Core\Access\CsrfAccessCheck;
+use Drupal\Core\Access\CsrfTokenGenerator;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -36,11 +38,11 @@ class CsrfAccessCheckTest extends UnitTestCase {
   protected $routeMatch;
 
   protected function setUp() {
-    $this->csrfToken = $this->getMockBuilder('Drupal\Core\Access\CsrfTokenGenerator')
+    $this->csrfToken = $this->getMockBuilder(CsrfTokenGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
 
-    $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $this->routeMatch = $this->getMock(RouteMatchInterface::class);
 
     $this->accessCheck = new CsrfAccessCheck($this->csrfToken);
   }
diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
index 52ed59c..6c33072 100644
--- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
@@ -2,9 +2,11 @@
 
 namespace Drupal\Tests\Core\Access;
 
+use Drupal\Core\PrivateKey;
 use Drupal\Core\Site\Settings;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Access\CsrfTokenGenerator;
+use Drupal\Core\Session\MetadataBag;
 use Drupal\Component\Utility\Crypt;
 
 /**
@@ -42,12 +44,12 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->privateKey = $this->getMockBuilder('Drupal\Core\PrivateKey')
+    $this->privateKey = $this->getMockBuilder(PrivateKey::class)
       ->disableOriginalConstructor()
       ->setMethods(['get'])
       ->getMock();
 
-    $this->sessionMetadata = $this->getMockBuilder('Drupal\Core\Session\MetadataBag')
+    $this->sessionMetadata = $this->getMockBuilder(MetadataBag::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
index 9f0c2c9..b3f036e 100644
--- a/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
@@ -7,8 +7,13 @@
 
 namespace Drupal\Tests\Core\Access;
 
+use Drupal\Component\Utility\ArgumentsResolverInterface;
+use Drupal\Core\Access\AccessArgumentsResolverFactoryInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Access\CustomAccessCheck;
+use Drupal\Core\Controller\ControllerResolverInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 
@@ -45,8 +50,8 @@ class CustomAccessCheckTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
-    $this->argumentsResolverFactory = $this->getMock('Drupal\Core\Access\AccessArgumentsResolverFactoryInterface');
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
+    $this->argumentsResolverFactory = $this->getMock(AccessArgumentsResolverFactoryInterface::class);
     $this->accessChecker = new CustomAccessCheck($this->controllerResolver, $this->argumentsResolverFactory);
   }
 
@@ -54,14 +59,14 @@ protected function setUp() {
    * Test the access method.
    */
   public function testAccess() {
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
 
     $this->controllerResolver->expects($this->at(0))
       ->method('getControllerFromDefinition')
       ->with('\Drupal\Tests\Core\Access\TestController::accessDeny')
       ->will($this->returnValue([new TestController(), 'accessDeny']));
 
-    $resolver0 = $this->getMock('Drupal\Component\Utility\ArgumentsResolverInterface');
+    $resolver0 = $this->getMock(ArgumentsResolverInterface::class);
     $resolver0->expects($this->once())
       ->method('getArguments')
       ->will($this->returnValue([]));
@@ -74,7 +79,7 @@ public function testAccess() {
       ->with('\Drupal\Tests\Core\Access\TestController::accessAllow')
       ->will($this->returnValue([new TestController(), 'accessAllow']));
 
-    $resolver1 = $this->getMock('Drupal\Component\Utility\ArgumentsResolverInterface');
+    $resolver1 = $this->getMock(ArgumentsResolverInterface::class);
     $resolver1->expects($this->once())
       ->method('getArguments')
       ->will($this->returnValue([]));
@@ -87,7 +92,7 @@ public function testAccess() {
       ->with('\Drupal\Tests\Core\Access\TestController::accessParameter')
       ->will($this->returnValue([new TestController(), 'accessParameter']));
 
-    $resolver2 = $this->getMock('Drupal\Component\Utility\ArgumentsResolverInterface');
+    $resolver2 = $this->getMock(ArgumentsResolverInterface::class);
     $resolver2->expects($this->once())
       ->method('getArguments')
       ->will($this->returnValue(['parameter' => 'TRUE']));
@@ -96,7 +101,7 @@ public function testAccess() {
       ->will($this->returnValue($resolver2));
 
     $route = new Route('/test-route', [], ['_custom_access' => '\Drupal\Tests\Core\Access\TestController::accessDeny']);
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $this->assertEquals(AccessResult::neutral(), $this->accessChecker->access($route, $route_match, $account));
 
     $route = new Route('/test-route', [], ['_custom_access' => '\Drupal\Tests\Core\Access\TestController::accessAllow']);
diff --git a/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
index e465858..7ab0037 100644
--- a/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Access\DefaultAccessCheck;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Route;
@@ -34,7 +35,7 @@ class DefaultAccessCheckTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->account = $this->getMock(AccountInterface::class);
     $this->accessChecker = new DefaultAccessCheck();
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php b/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
index 2fef35f..e1022bf 100644
--- a/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Access;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\Core\Access\CsrfTokenGenerator;
 use Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Access\RouteProcessorCsrf;
@@ -29,7 +30,7 @@ class RouteProcessorCsrfTest extends UnitTestCase {
   protected $processor;
 
   protected function setUp() {
-    $this->csrfToken = $this->getMockBuilder('Drupal\Core\Access\CsrfTokenGenerator')
+    $this->csrfToken = $this->getMockBuilder(CsrfTokenGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
index 4db1d02..315c33f 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
@@ -21,6 +21,8 @@
 use Drupal\Core\Ajax\SettingsCommand;
 use Drupal\Core\Ajax\CloseDialogCommand;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
+use Drupal\Core\Ajax\OpenDialogCommand;
+use Drupal\Core\Ajax\OpenModalDialogCommand;
 use Drupal\Core\Ajax\SetDialogOptionCommand;
 use Drupal\Core\Ajax\SetDialogTitleCommand;
 use Drupal\Core\Ajax\RedirectCommand;
@@ -293,7 +295,7 @@ public function testSettingsCommand() {
    * @covers \Drupal\Core\Ajax\OpenDialogCommand
    */
   public function testOpenDialogCommand() {
-    $command = $this->getMockBuilder('Drupal\Core\Ajax\OpenDialogCommand')
+    $command = $this->getMockBuilder(OpenDialogCommand::class)
       ->setConstructorArgs([
         '#some-dialog', 'Title', '<p>Text!</p>', [
           'url' => FALSE,
@@ -328,7 +330,7 @@ public function testOpenDialogCommand() {
    * @covers \Drupal\Core\Ajax\OpenModalDialogCommand
    */
   public function testOpenModalDialogCommand() {
-    $command = $this->getMockBuilder('Drupal\Core\Ajax\OpenModalDialogCommand')
+    $command = $this->getMockBuilder(OpenModalDialogCommand::class)
       ->setConstructorArgs([
         'Title', '<p>Text!</p>', [
           'url' => 'example',
diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
index 880aaec..ff13213 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\Tests\Core\Ajax;
 
+use \Drupal\Core\Render\AttachmentsResponseProcessorInterface;
 use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Ajax\CommandInterface;
 use Drupal\Core\EventSubscriber\AjaxResponseSubscriber;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -33,15 +35,15 @@ protected function setUp() {
    * @see \Drupal\Core\Ajax\AjaxResponse::getCommands()
    */
   public function testCommands() {
-    $command_one = $this->getMock('Drupal\Core\Ajax\CommandInterface');
+    $command_one = $this->getMock(CommandInterface::class);
     $command_one->expects($this->once())
       ->method('render')
       ->will($this->returnValue(['command' => 'one']));
-    $command_two = $this->getMock('Drupal\Core\Ajax\CommandInterface');
+    $command_two = $this->getMock(CommandInterface::class);
     $command_two->expects($this->once())
       ->method('render')
       ->will($this->returnValue(['command' => 'two']));
-    $command_three = $this->getMock('Drupal\Core\Ajax\CommandInterface');
+    $command_three = $this->getMock(CommandInterface::class);
     $command_three->expects($this->once())
       ->method('render')
       ->will($this->returnValue(['command' => 'three']));
@@ -78,10 +80,10 @@ public function testPrepareResponseForIeFormRequestsWithFileUpload() {
     $response = new AjaxResponse([]);
     $response->headers->set('Content-Type', 'application/json; charset=utf-8');
 
-    $ajax_response_attachments_processor = $this->getMock('\Drupal\Core\Render\AttachmentsResponseProcessorInterface');
+    $ajax_response_attachments_processor = $this->getMock(AttachmentsResponseProcessorInterface::class);
     $subscriber = new AjaxResponseSubscriber($ajax_response_attachments_processor);
     $event = new FilterResponseEvent(
-      $this->getMock('\Symfony\Component\HttpKernel\HttpKernelInterface'),
+      $this->getMock(\Symfony\Component\HttpKernel\HttpKernelInterface::class),
       $request,
       HttpKernelInterface::MASTER_REQUEST,
       $response
diff --git a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
index 6ed63aa..67c9250 100644
--- a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
@@ -7,9 +7,16 @@
 
 namespace Drupal\Tests\Core\Asset;
 
+use \Drupal\Core\Asset\LibraryDependencyResolverInterface;
+use \Drupal\Core\Extension\ModuleHandlerInterface;
+use \Drupal\Core\Language\LanguageInterface;
+use \Drupal\Core\Language\LanguageManagerInterface;
+use \Drupal\Core\Theme\ActiveTheme;
+use \Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Core\Asset\AssetResolver;
 use Drupal\Core\Asset\AttachedAssets;
 use Drupal\Core\Asset\AttachedAssetsInterface;
+use Drupal\Core\Asset\LibraryDiscovery;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Tests\UnitTestCase;
 
@@ -74,16 +81,16 @@ class AssetResolverTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->libraryDiscovery = $this->getMockBuilder('Drupal\Core\Asset\LibraryDiscovery')
+    $this->libraryDiscovery = $this->getMockBuilder(LibraryDiscovery::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->libraryDependencyResolver = $this->getMock('\Drupal\Core\Asset\LibraryDependencyResolverInterface');
+    $this->libraryDependencyResolver = $this->getMock(LibraryDependencyResolverInterface::class);
     $this->libraryDependencyResolver->expects($this->any())
       ->method('getLibrariesWithDependencies')
       ->willReturnArgument(0);
-    $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->themeManager = $this->getMock('\Drupal\Core\Theme\ThemeManagerInterface');
-    $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
+    $active_theme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $active_theme->expects($this->any())
@@ -93,16 +100,16 @@ protected function setUp() {
       ->method('getActiveTheme')
       ->willReturn($active_theme);
 
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
-    $english = $this->getMock('\Drupal\Core\Language\LanguageInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
+    $english = $this->getMock(LanguageInterface::class);
     $english->expects($this->any())
       ->method('getId')
       ->willReturn('en');
-    $japanese = $this->getMock('\Drupal\Core\Language\LanguageInterface');
+    $japanese = $this->getMock(LanguageInterface::class);
     $japanese->expects($this->any())
       ->method('getId')
       ->willReturn('jp');
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getCurrentLanguage')
       ->will($this->onConsecutiveCalls($english, $english, $japanese, $japanese));
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
index c7f1f3d..806eb0d 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Asset;
 
 use Drupal\Core\Asset\CssCollectionRenderer;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -36,7 +37,7 @@ class CssCollectionRendererUnitTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->state = $this->getMock('Drupal\Core\State\StateInterface');
+    $this->state = $this->getMock(StateInterface::class);
 
     $this->renderer = new CssCollectionRenderer($this->state);
     $this->fileCssGroup = [
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
index 40e1821..99570c2 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Asset;
 
 use Drupal\Core\Asset\LibraryDependencyResolver;
+use Drupal\Core\Asset\LibraryDiscovery;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -53,7 +54,7 @@ class LibraryDependencyResolverTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->libraryDiscovery = $this->getMockBuilder('Drupal\Core\Asset\LibraryDiscovery')
+    $this->libraryDiscovery = $this->getMockBuilder(LibraryDiscovery::class)
       ->disableOriginalConstructor()
       ->setMethods(['getLibrariesByExtension'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
index 2eb34d3..3b7a5d3 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
@@ -3,7 +3,12 @@
 namespace Drupal\Tests\Core\Asset;
 
 use Drupal\Core\Asset\LibraryDiscoveryCollector;
+use Drupal\Core\Asset\LibraryDiscoveryParser;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Theme\ActiveTheme;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -69,12 +74,12 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
-    $this->themeManager = $this->getMockBuilder('Drupal\Core\Theme\ThemeManagerInterface')
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
+    $this->themeManager = $this->getMockBuilder(ThemeManagerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->libraryDiscoveryParser = $this->getMockBuilder('Drupal\Core\Asset\LibraryDiscoveryParser')
+    $this->libraryDiscoveryParser = $this->getMockBuilder(LibraryDiscoveryParser::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -86,7 +91,7 @@ protected function setUp() {
    * @covers ::resolveCacheMiss
    */
   public function testResolveCacheMiss() {
-    $this->activeTheme = $this->getMockBuilder('Drupal\Core\Theme\ActiveTheme')
+    $this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->themeManager->expects($this->exactly(3))
@@ -112,7 +117,7 @@ public function testResolveCacheMiss() {
    * @covers ::destruct
    */
   public function testDestruct() {
-    $this->activeTheme = $this->getMockBuilder('Drupal\Core\Theme\ActiveTheme')
+    $this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->themeManager->expects($this->exactly(3))
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
index f65d932..2d61964 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
@@ -11,6 +11,9 @@
 use Drupal\Core\Asset\Exception\InvalidLibraryFileException;
 use Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException;
 use Drupal\Core\Asset\LibraryDiscoveryParser;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Theme\ActiveTheme;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -60,9 +63,9 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
-    $mock_active_theme = $this->getMockBuilder('Drupal\Core\Theme\ActiveTheme')
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
+    $mock_active_theme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $mock_active_theme->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
index 67da06e..f9f108f 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\Asset;
 
 use Drupal\Core\Asset\LibraryDiscovery;
+use Drupal\Core\Asset\LibraryDiscoveryCollector;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -58,8 +60,8 @@ class LibraryDiscoveryTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
-    $this->libraryDiscoveryCollector = $this->getMockBuilder('Drupal\Core\Asset\LibraryDiscoveryCollector')
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
+    $this->libraryDiscoveryCollector = $this->getMockBuilder(LibraryDiscoveryCollector::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->libraryDiscovery = new LibraryDiscovery($this->libraryDiscoveryCollector, $this->cacheTagsInvalidator);
diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
index 315d5d6..1694d3a 100644
--- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
@@ -29,7 +29,7 @@ class AuthenticationManagerTest extends UnitTestCase {
    * @dataProvider providerTestDefaultFilter
    */
   public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global) {
-    $auth_provider = $this->getMock('Drupal\Core\Authentication\AuthenticationProviderInterface');
+    $auth_provider = $this->getMock(AuthenticationProviderInterface::class);
     $auth_collector = new AuthenticationCollector();
     $auth_collector->addProvider($auth_provider, $provider_id, 0, $global);
     $authentication_manager = new AuthenticationManager($auth_collector);
diff --git a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
index 70bc7f2..fe84718 100644
--- a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\Block;
 
 use Drupal\block_test\Plugin\Block\TestBlockInstantiation;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Transliteration\PhpTransliteration;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -17,8 +19,8 @@ class BlockBaseTest extends UnitTestCase {
    * @see \Drupal\Core\Block\BlockBase::getMachineNameSuggestion()
    */
   public function testGetMachineNameSuggestion() {
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $transliteration = $this->getMockBuilder('Drupal\Core\Transliteration\PhpTransliteration')
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
+    $transliteration = $this->getMockBuilder(PhpTransliteration::class)
       ->setConstructorArgs([NULL, $module_handler])
       ->setMethods(['readLanguageOverrides'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
index aed60a6..b7aa4e3 100644
--- a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
@@ -3,10 +3,13 @@
 namespace Drupal\Tests\Core\Breadcrumb;
 
 use Drupal\Core\Breadcrumb\Breadcrumb;
+use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
 use Drupal\Core\Breadcrumb\BreadcrumbManager;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -47,7 +50,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->breadcrumbManager = new BreadcrumbManager($this->moduleHandler);
     $this->breadcrumb = new Breadcrumb();
 
@@ -63,12 +66,12 @@ protected function setUp() {
    * Tests the breadcrumb manager without any set breadcrumb.
    */
   public function testBuildWithoutBuilder() {
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('alter')
       ->with('system_breadcrumb', $this->breadcrumb, $route_match, ['builder' => NULL]);
 
-    $breadcrumb = $this->breadcrumbManager->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $breadcrumb = $this->breadcrumbManager->build($this->getMock(RouteMatchInterface::class));
     $this->assertEquals([], $breadcrumb->getLinks());
     $this->assertEquals([], $breadcrumb->getCacheContexts());
     $this->assertEquals([], $breadcrumb->getCacheTags());
@@ -79,7 +82,7 @@ public function testBuildWithoutBuilder() {
    * Tests the build method with a single breadcrumb builder.
    */
   public function testBuildWithSingleBuilder() {
-    $builder = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder = $this->getMock(BreadcrumbBuilderInterface::class);
     $links = ['<a href="/example">Test</a>'];
     $this->breadcrumb->setLinks($links);
     $this->breadcrumb->addCacheContexts(['foo'])->addCacheTags(['bar']);
@@ -92,7 +95,7 @@ public function testBuildWithSingleBuilder() {
       ->method('build')
       ->willReturn($this->breadcrumb);
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $this->moduleHandler->expects($this->once())
       ->method('alter')
       ->with('system_breadcrumb', $this->breadcrumb, $route_match, ['builder' => $builder]);
@@ -110,13 +113,13 @@ public function testBuildWithSingleBuilder() {
    * Tests multiple breadcrumb builder with different priority.
    */
   public function testBuildWithMultipleApplyingBuilders() {
-    $builder1 = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder1 = $this->getMock(BreadcrumbBuilderInterface::class);
     $builder1->expects($this->never())
       ->method('applies');
     $builder1->expects($this->never())
       ->method('build');
 
-    $builder2 = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder2 = $this->getMock(BreadcrumbBuilderInterface::class);
     $links2 = ['<a href="/example2">Test2</a>'];
     $this->breadcrumb->setLinks($links2);
     $this->breadcrumb->addCacheContexts(['baz'])->addCacheTags(['qux']);
@@ -127,7 +130,7 @@ public function testBuildWithMultipleApplyingBuilders() {
       ->method('build')
       ->willReturn($this->breadcrumb);
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
 
     $this->moduleHandler->expects($this->once())
       ->method('alter')
@@ -147,14 +150,14 @@ public function testBuildWithMultipleApplyingBuilders() {
    * Tests multiple breadcrumb builders of which one returns NULL.
    */
   public function testBuildWithOneNotApplyingBuilders() {
-    $builder1 = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder1 = $this->getMock(BreadcrumbBuilderInterface::class);
     $builder1->expects($this->once())
       ->method('applies')
       ->will($this->returnValue(FALSE));
     $builder1->expects($this->never())
       ->method('build');
 
-    $builder2 = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder2 = $this->getMock(BreadcrumbBuilderInterface::class);
     $links2 = ['<a href="/example2">Test2</a>'];
     $this->breadcrumb->setLinks($links2);
     $this->breadcrumb->addCacheContexts(['baz'])->addCacheTags(['qux']);
@@ -165,7 +168,7 @@ public function testBuildWithOneNotApplyingBuilders() {
       ->method('build')
       ->willReturn($this->breadcrumb);
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
 
     $this->moduleHandler->expects($this->once())
       ->method('alter')
@@ -185,7 +188,7 @@ public function testBuildWithOneNotApplyingBuilders() {
    * Tests a breadcrumb builder with a bad return value.
    */
   public function testBuildWithInvalidBreadcrumbResult() {
-    $builder = $this->getMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
+    $builder = $this->getMock(BreadcrumbBuilderInterface::class);
     $builder->expects($this->once())
       ->method('applies')
       ->will($this->returnValue(TRUE));
@@ -195,7 +198,7 @@ public function testBuildWithInvalidBreadcrumbResult() {
 
     $this->breadcrumbManager->addBuilder($builder, 0);
     $this->setExpectedException(\UnexpectedValueException::class);
-    $this->breadcrumbManager->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface'));
+    $this->breadcrumbManager->build($this->getMock(RouteMatchInterface::class));
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
index ad51768..77df992 100644
--- a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Cache\BackendChain;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Tests\UnitTestCase;
 
@@ -290,7 +291,7 @@ public function testDeleteTagsPropagation() {
   public function testRemoveBin() {
     $chain = new BackendChain('foo');
     for ($i = 0; $i < 3; $i++) {
-      $backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+      $backend = $this->getMock(CacheBackendInterface::class);
       $backend->expects($this->once())->method('removeBin');
       $chain->appendBackend($backend);
     }
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
index 1ff6629..c586281 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
@@ -3,6 +3,9 @@
 namespace Drupal\Tests\Core\Cache;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -50,9 +53,9 @@ class CacheCollectorTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
+    $this->cacheBackend = $this->getMock(CacheBackendInterface::class);
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
     $this->cid = $this->randomMachineName();
     $this->collector = new CacheCollectorHelper($this->cid, $this->cacheBackend, $this->lock);
 
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
index 0c43bb2..fa25cf6 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use \Drupal\Core\Cache\CacheBackendInterface;
+use \Drupal\Core\Cache\CacheFactoryInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Cache\CacheFactory;
 use Drupal\Core\Site\Settings;
@@ -26,10 +28,10 @@ public function testCacheFactoryWithDefaultSettings() {
     $container = new ContainerBuilder();
     $cache_factory->setContainer($container);
 
-    $builtin_default_backend_factory = $this->getMock('\Drupal\Core\Cache\CacheFactoryInterface');
+    $builtin_default_backend_factory = $this->getMock(CacheFactoryInterface::class);
     $container->set('cache.backend.database', $builtin_default_backend_factory);
 
-    $render_bin = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $render_bin = $this->getMock(CacheBackendInterface::class);
     $builtin_default_backend_factory->expects($this->once())
       ->method('get')
       ->with('render')
@@ -56,10 +58,10 @@ public function testCacheFactoryWithCustomizedDefaultBackend() {
     $container = new ContainerBuilder();
     $cache_factory->setContainer($container);
 
-    $custom_default_backend_factory = $this->getMock('\Drupal\Core\Cache\CacheFactoryInterface');
+    $custom_default_backend_factory = $this->getMock(CacheFactoryInterface::class);
     $container->set('cache.backend.custom', $custom_default_backend_factory);
 
-    $render_bin = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $render_bin = $this->getMock(CacheBackendInterface::class);
     $custom_default_backend_factory->expects($this->once())
       ->method('get')
       ->with('render')
@@ -92,10 +94,10 @@ public function testCacheFactoryWithDefaultBinBackend() {
     $container = new ContainerBuilder();
     $cache_factory->setContainer($container);
 
-    $custom_default_backend_factory = $this->getMock('\Drupal\Core\Cache\CacheFactoryInterface');
+    $custom_default_backend_factory = $this->getMock(CacheFactoryInterface::class);
     $container->set('cache.backend.custom', $custom_default_backend_factory);
 
-    $render_bin = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $render_bin = $this->getMock(CacheBackendInterface::class);
     $custom_default_backend_factory->expects($this->once())
       ->method('get')
       ->with('render')
@@ -132,10 +134,10 @@ public function testCacheFactoryWithSpecifiedPerBinBackend() {
     $container = new ContainerBuilder();
     $cache_factory->setContainer($container);
 
-    $custom_render_backend_factory = $this->getMock('\Drupal\Core\Cache\CacheFactoryInterface');
+    $custom_render_backend_factory = $this->getMock(CacheFactoryInterface::class);
     $container->set('cache.backend.custom', $custom_render_backend_factory);
 
-    $render_bin = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $render_bin = $this->getMock(CacheBackendInterface::class);
     $custom_render_backend_factory->expects($this->once())
       ->method('get')
       ->with('render')
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
index 5466a09..80c3739 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use \Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\CacheTagsInvalidator;
 use Drupal\Core\DependencyInjection\Container;
 use Drupal\Tests\UnitTestCase;
@@ -31,7 +32,7 @@ public function testInvalidateTags() {
     // This does not actually implement,
     // \Drupal\Cache\Cache\CacheBackendInterface but we can not mock from two
     // interfaces, we would need a test class for that.
-    $invalidator_cache_bin = $this->getMock('\Drupal\Core\Cache\CacheTagsInvalidator');
+    $invalidator_cache_bin = $this->getMock(\Drupal\Core\Cache\CacheTagsInvalidator::class);
     $invalidator_cache_bin->expects($this->once())
       ->method('invalidateTags')
       ->with(['node:1']);
@@ -39,7 +40,7 @@ public function testInvalidateTags() {
     // We do not have to define that invalidateTags() is never called as the
     // interface does not define that method, trying to call it would result in
     // a fatal error.
-    $non_invalidator_cache_bin = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $non_invalidator_cache_bin = $this->getMock(CacheBackendInterface::class);
 
     $container = new Container();
     $container->set('cache.invalidator_cache_bin', $invalidator_cache_bin);
@@ -47,7 +48,7 @@ public function testInvalidateTags() {
     $container->setParameter('cache_bins', ['cache.invalidator_cache_bin' => 'invalidator_cache_bin', 'cache.non_invalidator_cache_bin' => 'non_invalidator_cache_bin']);
     $cache_tags_invalidator->setContainer($container);
 
-    $invalidator = $this->getMock('\Drupal\Core\Cache\CacheTagsInvalidator');
+    $invalidator = $this->getMock(\Drupal\Core\Cache\CacheTagsInvalidator::class);
     $invalidator->expects($this->once())
       ->method('invalidateTags')
       ->with(['node:1']);
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
index 5eecf1c..e445f58 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Tests\Core\Render\TestCacheableDependency;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -26,7 +27,7 @@ class CacheableMetadataTest extends UnitTestCase {
    * @see \Drupal\Tests\Core\Cache\CacheContextsTest
    */
   public function testMerge(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected) {
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -50,7 +51,7 @@ public function testMerge(CacheableMetadata $a, CacheableMetadata $b, CacheableM
    * @see \Drupal\Tests\Core\Cache\CacheContextsTest
    */
   public function testAddCacheableDependency(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected) {
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -111,7 +112,7 @@ public function testAddCacheTags() {
   public function testSetCacheMaxAge($data, $expect_exception) {
     $metadata = new CacheableMetadata();
     if ($expect_exception) {
-      $this->setExpectedException('\InvalidArgumentException');
+      $this->setExpectedException(\InvalidArgumentException::class);
     }
     $metadata->setCacheMaxAge($data);
     $this->assertEquals($data, $metadata->getCacheMaxAge());
diff --git a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
index 52f1851..64f9743 100644
--- a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\ChainedFastBackend;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Tests\UnitTestCase;
@@ -37,7 +38,7 @@ class ChainedFastBackendTest extends UnitTestCase {
    * Tests a get() on the fast backend, with no hit on the consistent backend.
    */
   public function testGetDoesntHitConsistentBackend() {
-    $consistent_cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $consistent_cache = $this->getMock(CacheBackendInterface::class);
     $timestamp_cid = ChainedFastBackend::LAST_WRITE_TIMESTAMP_PREFIX . 'cache_foo';
     // Use the request time because that is what we will be comparing against.
     $timestamp_item = (object) ['cid' => $timestamp_cid, 'data' => (int) $_SERVER['REQUEST_TIME'] - 60];
@@ -74,8 +75,8 @@ public function testFallThroughToConsistentCache() {
       'tags' => ['tag'],
     ];
 
-    $consistent_cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $fast_cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $consistent_cache = $this->getMock(CacheBackendInterface::class);
+    $fast_cache = $this->getMock(CacheBackendInterface::class);
 
     // We should get a call for the timestamp on the consistent backend.
     $consistent_cache->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
index f89e639..a5586d3 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
@@ -27,7 +27,7 @@ class CacheContextsManagerTest extends UnitTestCase {
    * @dataProvider providerTestOptimizeTokens
    */
   public function testOptimizeTokens(array $context_tokens, array $optimized_context_tokens) {
-    $container = $this->getMockBuilder('Drupal\Core\DependencyInjection\Container')
+    $container = $this->getMockBuilder(\Drupal\Core\DependencyInjection\Container::class)
       ->disableOriginalConstructor()
       ->getMock();
     $container->expects($this->any())
@@ -156,7 +156,7 @@ protected function getContextsFixture() {
   }
 
   protected function getMockContainer() {
-    $container = $this->getMockBuilder('Drupal\Core\DependencyInjection\Container')
+    $container = $this->getMockBuilder(\Drupal\Core\DependencyInjection\Container::class)
       ->disableOriginalConstructor()
       ->getMock();
     $container->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
index 9538bd2..23d3c8e 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache\Context;
 
+use \Symfony\Component\HttpFoundation\Session\SessionInterface;
 use Drupal\Core\Cache\Context\SessionCacheContext;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -40,7 +41,7 @@ public function setUp() {
     $this->requestStack = new RequestStack();
     $this->requestStack->push($request);
 
-    $this->session = $this->getMock('\Symfony\Component\HttpFoundation\Session\SessionInterface');
+    $this->session = $this->getMock(SessionInterface::class);
     $request->setSession($this->session);
 
     $this->cacheContext = new SessionCacheContext($this->requestStack);
diff --git a/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
index f0da231..1d73ba9 100644
--- a/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\Tests\Core\Condition;
 
 use Drupal\Component\Plugin\Exception\ContextException;
+use Drupal\Core\Condition\ConditionInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -31,22 +32,22 @@ public function testResolveConditions($conditions, $logic, $expected) {
   public function providerTestResolveConditions() {
     $data = [];
 
-    $condition_true = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_true = $this->getMock(ConditionInterface::class);
     $condition_true->expects($this->any())
       ->method('execute')
       ->will($this->returnValue(TRUE));
-    $condition_false = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_false = $this->getMock(ConditionInterface::class);
     $condition_false->expects($this->any())
       ->method('execute')
       ->will($this->returnValue(FALSE));
-    $condition_exception = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_exception = $this->getMock(ConditionInterface::class);
     $condition_exception->expects($this->any())
       ->method('execute')
       ->will($this->throwException(new ContextException()));
     $condition_exception->expects($this->atLeastOnce())
       ->method('isNegated')
       ->will($this->returnValue(FALSE));
-    $condition_negated = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_negated = $this->getMock(ConditionInterface::class);
     $condition_negated->expects($this->any())
       ->method('execute')
       ->will($this->throwException(new ContextException()));
diff --git a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
index c39efd6..a83921c 100644
--- a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Config\CachedStorage;
+use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Cache\NullBackend;
 
 /**
@@ -23,7 +24,7 @@ class CachedStorageTest extends UnitTestCase {
    */
   public function testListAllStaticCache() {
     $prefix = __FUNCTION__;
-    $storage = $this->getMock('Drupal\Core\Config\StorageInterface');
+    $storage = $this->getMock(StorageInterface::class);
 
     $response = ["$prefix." . $this->randomMachineName(), "$prefix." . $this->randomMachineName()];
     $storage->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
index 3c7cac1..2df3768 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
@@ -2,8 +2,11 @@
 
 namespace Drupal\Tests\Core\Config;
 
+use \Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigFactory;
+use Drupal\Core\Config\StorageInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -52,12 +55,12 @@ class ConfigFactoryTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
+    $this->storage = $this->getMock(StorageInterface::class);
     $this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfig = $this->getMock(TypedConfigManagerInterface::class);
     $this->configFactory = new ConfigFactory($this->storage, $this->eventDispatcher, $this->typedConfig);
 
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator);
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
index 41c3e93..53bd9de 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
@@ -2,11 +2,15 @@
 
 namespace Drupal\Tests\Core\Config;
 
+use \Drupal\Core\Config\ConfigNameException;
+use \Drupal\Core\Config\TypedConfigManagerInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Render\Markup;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigValueException;
+use Drupal\Core\Config\StorageInterface;
 
 /**
  * Tests the Config.
@@ -55,11 +59,11 @@ class ConfigTest extends UnitTestCase {
   protected $cacheTagsInvalidator;
 
   protected function setUp() {
-    $this->storage = $this->getMock('Drupal\Core\Config\StorageInterface');
+    $this->storage = $this->getMock(StorageInterface::class);
     $this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $this->typedConfig = $this->getMock('\Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfig = $this->getMock(TypedConfigManagerInterface::class);
     $this->config = new Config('config.test', $this->storage, $this->eventDispatcher, $this->typedConfig);
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator);
@@ -142,7 +146,7 @@ public function testSaveNew($data) {
     $config = $this->config->save();
 
     // Check that returned $config is instance of Config.
-    $this->assertInstanceOf('\Drupal\Core\Config\Config', $config);
+    $this->assertInstanceOf(\Drupal\Core\Config\Config::class, $config);
 
     // Check that the original data it saved.
     $this->assertOriginalConfigDataEquals($data, TRUE);
@@ -257,7 +261,7 @@ public function testInitWithData($data) {
     $config = $this->config->initWithData($data);
 
     // Should return the Config object.
-    $this->assertInstanceOf('\Drupal\Core\Config\Config', $config);
+    $this->assertInstanceOf(\Drupal\Core\Config\Config::class, $config);
 
     // Check config is not new.
     $this->assertEquals(FALSE, $this->config->isNew());
@@ -387,7 +391,7 @@ public function mergeDataProvider() {
    * @dataProvider validateNameProvider
    */
   public function testValidateNameException($name, $exception_message) {
-    $this->setExpectedException('\Drupal\Core\Config\ConfigNameException', $exception_message);
+    $this->setExpectedException(ConfigNameException::class, $exception_message);
     $this->config->validateName($name);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
index 0a5d3d3..a1ab508 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
@@ -7,7 +7,18 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityBase;
+use \Drupal\Core\Config\Entity\ConfigEntityInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityStorageInterface;
+use \Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
+use \Drupal\Core\Entity\Entity;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\Query\QueryInterface;
+use \Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Component\Plugin\PluginManagerInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Core\Config\Schema\SchemaIncompleteException;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\Language;
@@ -104,7 +115,7 @@ protected function setUp() {
     ];
     $this->entityTypeId = $this->randomMachineName();
     $this->provider = $this->randomMachineName();
-    $this->entityType = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $this->entityType = $this->getMock(ConfigEntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue($this->provider));
@@ -112,23 +123,23 @@ protected function setUp() {
       ->method('getConfigPrefix')
       ->willReturn('test_provider.' . $this->entityTypeId);
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getLanguage')
       ->with('en')
       ->will($this->returnValue(new Language(['id' => 'en'])));
 
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
-    $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $this->typedConfigManager = $this->getMock(TypedConfigManagerInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -138,7 +149,7 @@ protected function setUp() {
     $container->set('config.typed', $this->typedConfigManager);
     \Drupal::setContainer($container);
 
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Config\Entity\ConfigEntityBase', [$values, $this->entityTypeId]);
+    $this->entity = $this->getMockForAbstractClass(ConfigEntityBase::class, [$values, $this->entityTypeId]);
   }
 
   /**
@@ -162,8 +173,8 @@ public function testCalculateDependencies() {
    * @covers ::preSave
    */
   public function testPreSaveDuringSync() {
-    $query = $this->getMock('\Drupal\Core\Entity\Query\QueryInterface');
-    $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
+    $query = $this->getMock(QueryInterface::class);
+    $storage = $this->getMock(ConfigEntityStorageInterface::class);
 
     $query->expects($this->any())
       ->method('execute')
@@ -195,7 +206,7 @@ public function testPreSaveDuringSync() {
    * @covers ::addDependency
    */
   public function testAddDependency() {
-    $method = new \ReflectionMethod('\Drupal\Core\Config\Entity\ConfigEntityBase', 'addDependency');
+    $method = new \ReflectionMethod(ConfigEntityBase::class, 'addDependency');
     $method->setAccessible(TRUE);
     $method->invoke($this->entity, 'module', $this->provider);
     $method->invoke($this->entity, 'module', 'core');
@@ -234,7 +245,7 @@ public function testCalculateDependenciesWithPluginCollections($definition, $exp
     $instance = new TestConfigurablePlugin([], $instance_id, $definition);
 
     // Create a plugin collection to contain the instance.
-    $pluginCollection = $this->getMockBuilder('\Drupal\Core\Plugin\DefaultLazyPluginCollection')
+    $pluginCollection = $this->getMockBuilder(\Drupal\Core\Plugin\DefaultLazyPluginCollection::class)
       ->disableOriginalConstructor()
       ->setMethods(['get'])
       ->getMock();
@@ -298,7 +309,7 @@ public function providerCalculateDependenciesWithPluginCollections() {
    * @covers ::onDependencyRemoval
    */
   public function testCalculateDependenciesWithThirdPartySettings() {
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Config\Entity\ConfigEntityBase', [[], $this->entityTypeId]);
+    $this->entity = $this->getMockForAbstractClass(ConfigEntityBase::class, [[], $this->entityTypeId]);
     $this->entity->setThirdPartySetting('test_provider', 'test', 'test');
     $this->entity->setThirdPartySetting('test_provider2', 'test', 'test');
     $this->entity->setThirdPartySetting($this->provider, 'test', 'test');
@@ -454,7 +465,7 @@ public function testCreateDuplicate() {
       ->will($this->returnValue($new_uuid));
 
     $duplicate = $this->entity->createDuplicate();
-    $this->assertInstanceOf('\Drupal\Core\Entity\Entity', $duplicate);
+    $this->assertInstanceOf(Entity::class, $duplicate);
     $this->assertNotSame($this->entity, $duplicate);
     $this->assertFalse($this->entity->isNew());
     $this->assertTrue($duplicate->isNew());
@@ -477,11 +488,11 @@ public function testSort() {
         ],
       ]));
 
-    $entity_a = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $entity_a = $this->getMock(ConfigEntityInterface::class);
     $entity_a->expects($this->atLeastOnce())
       ->method('label')
       ->willReturn('foo');
-    $entity_b = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityInterface');
+    $entity_b = $this->getMock(ConfigEntityInterface::class);
     $entity_b->expects($this->atLeastOnce())
       ->method('label')
       ->willReturn('bar');
@@ -529,7 +540,7 @@ public function testToArray() {
    * @covers ::toArray
    */
   public function testToArrayIdKey() {
-    $entity = $this->getMockForAbstractClass('\Drupal\Core\Config\Entity\ConfigEntityBase', [[], $this->entityTypeId], '', TRUE, TRUE, TRUE, ['id', 'get']);
+    $entity = $this->getMockForAbstractClass(ConfigEntityBase::class, [[], $this->entityTypeId], '', TRUE, TRUE, TRUE, ['id', 'get']);
     $entity->expects($this->atLeastOnce())
       ->method('id')
       ->willReturn($this->id);
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
index 914d4f6..a60de7c 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use \Drupal\Core\Config\ConfigPrefixLengthException;
+use \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage;
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Config\Entity\ConfigEntityType;
 use Drupal\Core\Config\Entity\Exception\ConfigEntityStorageClassException;
@@ -44,7 +47,7 @@ public function testConfigPrefixLengthExceeds() {
     ];
     $config_entity = $this->setUpConfigEntityType($definition);
     $this->setExpectedException(
-      '\Drupal\Core\Config\ConfigPrefixLengthException',
+      ConfigPrefixLengthException::class,
       "The configuration file name prefix {$definition['provider']}.{$definition['config_prefix']} exceeds the maximum character limit of " . ConfigEntityType::PREFIX_LENGTH
     );
     $this->assertEmpty($config_entity->getConfigPrefix());
@@ -75,7 +78,7 @@ public function testConstruct() {
     $config_entity = new ConfigEntityType([
       'id' => 'example_config_entity_type',
     ]);
-    $this->assertEquals('Drupal\Core\Config\Entity\ConfigEntityStorage', $config_entity->getStorageClass());
+    $this->assertEquals(ConfigEntityStorage::class, $config_entity->getStorageClass());
   }
 
   /**
@@ -85,7 +88,7 @@ public function testConstructBadStorage() {
     $this->setExpectedException(ConfigEntityStorageClassException::class, '\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage is not \Drupal\Core\Config\Entity\ConfigEntityStorage or it does not extend it');
     new ConfigEntityType([
       'id' => 'example_config_entity_type',
-      'handlers' => ['storage' => '\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage']
+      'handlers' => ['storage' => KeyValueEntityStorage::class]
     ]);
   }
 
@@ -95,7 +98,7 @@ public function testConstructBadStorage() {
   public function testSetStorageClass() {
     $config_entity = $this->setUpConfigEntityType([]);
     $this->setExpectedException(ConfigEntityStorageClassException::class, '\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage is not \Drupal\Core\Config\Entity\ConfigEntityStorage or it does not extend it');
-    $config_entity->setStorageClass('\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage');
+    $config_entity->setStorageClass(KeyValueEntityStorage::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
index 8dd7e77..4714f17 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use \Drupal\Core\Entity\EntityDisplayBase;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -15,7 +16,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
    * @covers ::getTargetEntityTypeId
    */
   public function testGetTargetEntityTypeId() {
-    $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
+    $mock = $this->getMockForAbstractClass(EntityDisplayBase::class, [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'targetEntityType');
     $reflection->setAccessible(TRUE);
     $reflection->setValue($mock, 'test');
@@ -26,7 +27,7 @@ public function testGetTargetEntityTypeId() {
    * @covers ::getMode
    */
   public function testGetMode() {
-    $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
+    $mock = $this->getMockForAbstractClass(EntityDisplayBase::class, [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'mode');
     $reflection->setAccessible(TRUE);
     $reflection->setValue($mock, 'test');
@@ -37,7 +38,7 @@ public function testGetMode() {
    * @covers ::getOriginalMode
    */
   public function testGetOriginalMode() {
-    $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
+    $mock = $this->getMockForAbstractClass(EntityDisplayBase::class, [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'originalMode');
     $reflection->setAccessible(TRUE);
     $reflection->setValue($mock, 'test');
@@ -48,7 +49,7 @@ public function testGetOriginalMode() {
    * @covers ::getTargetBundle
    */
   public function testGetTargetBundle() {
-    $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
+    $mock = $this->getMockForAbstractClass(EntityDisplayBase::class, [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'bundle');
     $reflection->setAccessible(TRUE);
     $reflection->setValue($mock, 'test');
@@ -59,7 +60,7 @@ public function testGetTargetBundle() {
    * @covers ::setTargetBundle
    */
   public function testSetTargetBundle() {
-    $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
+    $mock = $this->getMockForAbstractClass(EntityDisplayBase::class, [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'bundle');
     $reflection->setAccessible(TRUE);
     $mock->setTargetBundle('test');
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
index 728fdca..f541aa4 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\EntityDisplayModeBase;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 
@@ -52,14 +56,14 @@ class EntityDisplayModeBaseUnitTest extends UnitTestCase {
   protected function setUp() {
     $this->entityType = $this->randomMachineName();
 
-    $this->entityInfo = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityInfo = $this->getMock(EntityTypeInterface::class);
     $this->entityInfo->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('entity'));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -73,7 +77,7 @@ protected function setUp() {
   public function testCalculateDependencies() {
     $target_entity_type_id = $this->randomMachineName(16);
 
-    $target_entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $target_entity_type = $this->getMock(EntityTypeInterface::class);
     $target_entity_type->expects($this->any())
       ->method('getProvider')
       ->will($this->returnValue('test_module'));
@@ -88,7 +92,7 @@ public function testCalculateDependencies() {
       ->with($this->entityType)
       ->will($this->returnValue($this->entityInfo));
 
-    $this->entity = $this->getMockBuilder('\Drupal\Core\Entity\EntityDisplayModeBase')
+    $this->entity = $this->getMockBuilder(EntityDisplayModeBase::class)
       ->setConstructorArgs([$values, $this->entityType])
       ->setMethods(['getFilterFormat'])
       ->getMock();
@@ -103,7 +107,7 @@ public function testCalculateDependencies() {
   public function testSetTargetType() {
     // Generate mock.
     $mock = $this->getMock(
-      'Drupal\Core\Entity\EntityDisplayModeBase',
+      \Drupal\Core\Entity\EntityDisplayModeBase::class,
       NULL,
       [['something' => 'nothing'], 'test_type']
     );
@@ -132,7 +136,7 @@ public function testSetTargetType() {
   public function testGetTargetType() {
     // Generate mock.
     $mock = $this->getMock(
-      'Drupal\Core\Entity\EntityDisplayModeBase',
+      \Drupal\Core\Entity\EntityDisplayModeBase::class,
       NULL,
       [['something' => 'nothing'], 'test_type']
     );
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
index f3c882c..3e38491 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
@@ -3,7 +3,11 @@
 namespace Drupal\Tests\Core\Config\Entity\Query;
 
 use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\ConfigManagerInterface;
+use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
 use Drupal\Core\Config\Entity\Query\QueryFactory;
+use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -19,10 +23,10 @@ class QueryFactoryTest extends UnitTestCase {
    * @dataProvider providerTestGetKeys
    */
   public function testGetKeys(array $expected, $key, Config $config) {
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
-    $key_value_factory = $this->getMock('Drupal\Core\KeyValueStore\KeyValueFactoryInterface');
-    $config_manager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface');
-    $config_entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
+    $key_value_factory = $this->getMock(KeyValueFactoryInterface::class);
+    $config_manager = $this->getMock(ConfigManagerInterface::class);
+    $config_entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $query_factory = new QueryFactory($config_factory, $key_value_factory, $config_manager);
     $method = new \ReflectionMethod($query_factory, 'getKeys');
     $method->setAccessible(TRUE);
@@ -100,10 +104,10 @@ public function providerTestGetKeys() {
    * @covers ::getValues
    */
   public function testGetKeysWildCardEnd() {
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
-    $key_value_factory = $this->getMock('Drupal\Core\KeyValueStore\KeyValueFactoryInterface');
-    $config_manager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface');
-    $config_entity_type = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
+    $key_value_factory = $this->getMock(KeyValueFactoryInterface::class);
+    $config_manager = $this->getMock(ConfigManagerInterface::class);
+    $config_entity_type = $this->getMock(ConfigEntityTypeInterface::class);
     $config_entity_type->expects($this->atLeastOnce())
       ->method('id')
       ->willReturn('test_config_entity_type');
@@ -125,7 +129,7 @@ public function testGetKeysWildCardEnd() {
    *   The test configuration object.
    */
   protected function getConfigObject($name) {
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->setMethods(['save', 'delete'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
index 0ac8299..07d7c48 100644
--- a/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
@@ -4,6 +4,8 @@
 
 use Drupal\Core\Config\ImmutableConfig;
 use Drupal\Core\Config\ImmutableConfigException;
+use Drupal\Core\Config\StorageInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -21,9 +23,9 @@ class ImmutableConfigTest extends UnitTestCase {
 
   protected function setUp() {
     parent::setUp();
-    $storage = $this->getMock('Drupal\Core\Config\StorageInterface');
+    $storage = $this->getMock(StorageInterface::class);
     $event_dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $typed_config = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface');
+    $typed_config = $this->getMock(TypedConfigManagerInterface::class);
     $this->config = new ImmutableConfig('test', $storage, $event_dispatcher, $typed_config);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php b/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
index fc0d63b..093df96 100644
--- a/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
@@ -3,7 +3,9 @@
 namespace Drupal\Tests\Core\Config;
 
 use Drupal\Component\Uuid\Php;
+use Drupal\Core\Config\ConfigManagerInterface;
 use Drupal\Core\Config\StorageComparer;
+use Drupal\Core\Config\StorageInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -42,9 +44,9 @@ class StorageComparerTest extends UnitTestCase {
   protected $configData;
 
   protected function setUp() {
-    $this->sourceStorage = $this->getMock('Drupal\Core\Config\StorageInterface');
-    $this->targetStorage = $this->getMock('Drupal\Core\Config\StorageInterface');
-    $this->configManager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface');
+    $this->sourceStorage = $this->getMock(StorageInterface::class);
+    $this->targetStorage = $this->getMock(StorageInterface::class);
+    $this->configManager = $this->getMock(ConfigManagerInterface::class);
     $this->storageComparer = new StorageComparer($this->sourceStorage, $this->targetStorage, $this->configManager);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php b/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
index 3d42dec..087045a 100644
--- a/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
@@ -7,7 +7,11 @@
 
 namespace Drupal\Tests\Core\Controller;
 
+use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Render\ElementInfoManagerInterface;
+use Drupal\Core\Render\Renderer;
 use Drupal\Core\Render\MainContent\AjaxRenderer;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -36,7 +40,7 @@ class AjaxRendererTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $element_info_manager = $this->getMock('Drupal\Core\Render\ElementInfoManagerInterface');
+    $element_info_manager = $this->getMock(ElementInfoManagerInterface::class);
     $element_info_manager->expects($this->any())
       ->method('getInfo')
       ->with('ajax')
@@ -47,7 +51,7 @@ protected function setUp() {
       ]);
     $this->ajaxRenderer = new TestAjaxRenderer($element_info_manager);
 
-    $this->renderer = $this->getMockBuilder('Drupal\Core\Render\Renderer')
+    $this->renderer = $this->getMockBuilder(Renderer::class)
       ->disableOriginalConstructor()
       ->setMethods(NULL)
       ->getMock();
@@ -64,11 +68,11 @@ protected function setUp() {
   public function testRenderWithFragmentObject() {
     $main_content = ['#markup' => 'example content'];
     $request = new Request();
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     /** @var \Drupal\Core\Ajax\AjaxResponse $result */
     $result = $this->ajaxRenderer->renderResponse($main_content, $request, $route_match);
 
-    $this->assertInstanceOf('Drupal\Core\Ajax\AjaxResponse', $result);
+    $this->assertInstanceOf(AjaxResponse::class, $result);
 
     $commands = $result->getCommands();
     $this->assertEquals('insert', $commands[0]['command']);
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
index 3f55f15..053fe65 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Controller;
 
+use Drupal\Core\Controller\ControllerBase;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -19,7 +20,7 @@ class ControllerBaseTest extends UnitTestCase {
   protected $controllerBase;
 
   protected function setUp() {
-    $this->controllerBase = $this->getMockForAbstractClass('Drupal\Core\Controller\ControllerBase');
+    $this->controllerBase = $this->getMockForAbstractClass(ControllerBase::class);
   }
 
   /**
@@ -42,7 +43,7 @@ public function testGetConfig() {
       ->will($this->returnValue($config_factory));
     \Drupal::setContainer($container);
 
-    $config_method = new \ReflectionMethod('Drupal\Core\Controller\ControllerBase', 'config');
+    $config_method = new \ReflectionMethod(ControllerBase::class, 'config');
     $config_method->setAccessible(TRUE);
 
     // Call config twice to ensure that the container is just called once.
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
index 0b7aa25..9438e66 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -10,9 +10,11 @@
 use Drupal\Core\Controller\ControllerResolver;
 use Drupal\Core\DependencyInjection\ClassResolver;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Routing\RouteMatch;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
@@ -76,10 +78,10 @@ protected function setUp() {
   public function testGetArguments() {
     $controller = function(EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) {
     };
-    $mock_entity = $this->getMockBuilder('Drupal\Core\Entity\Entity')
+    $mock_entity = $this->getMockBuilder(Entity::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $mock_account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $mock_account = $this->getMock(AccountInterface::class);
     $request = new Request([], [], [
       'entity' => $mock_entity,
       'user' => $mock_account,
diff --git a/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
index 7633f78..1495a7e 100644
--- a/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Tests\Core\Controller;
 
+use \Drupal\Core\Controller\ControllerResolverInterface;
+use \Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Core\Controller\TitleResolver;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\ParameterBag;
@@ -42,8 +44,8 @@ class TitleResolverTest extends UnitTestCase {
   protected $titleResolver;
 
   protected function setUp() {
-    $this->controllerResolver = $this->getMock('\Drupal\Core\Controller\ControllerResolverInterface');
-    $this->translationManager = $this->getMock('\Drupal\Core\StringTranslation\TranslationInterface');
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
+    $this->translationManager = $this->getMock(TranslationInterface::class);
 
     $this->titleResolver = new TitleResolver($this->controllerResolver, $this->translationManager);
   }
@@ -87,7 +89,7 @@ public function testStaticTitleWithParameter($title, $expected_title) {
   }
 
   public function providerTestStaticTitleWithParameter() {
-    $translation_manager = $this->getMock('\Drupal\Core\StringTranslation\TranslationInterface');
+    $translation_manager = $this->getMock(TranslationInterface::class);
     return [
       ['static title @test', new TranslatableMarkup('static title @test', ['@test' => 'value', '%test' => 'value', '@test2' => 'value2', '%test2' => 'value2'], [], $translation_manager)],
       ['static title %test', new TranslatableMarkup('static title %test', ['@test' => 'value', '%test' => 'value', '@test2' => 'value2', '%test2' => 'value2'], [], $translation_manager)],
diff --git a/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php b/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
index d25d2cd..b02c7fa 100644
--- a/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Database\Driver\pgsql;
 
+use \Drupal\Core\Database\StatementInterface;
+use \Drupal\Core\Database\Driver\pgsql\Connection;
 use Drupal\Core\Database\Driver\pgsql\Schema;
 use Drupal\Tests\UnitTestCase;
 
@@ -24,7 +26,7 @@ class PostgresqlSchemaTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->connection = $this->getMockBuilder('\Drupal\Core\Database\Driver\pgsql\Connection')
+    $this->connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
   }
@@ -46,7 +48,7 @@ public function testComputedConstraintName($table_name, $name, $expected) {
     $max_identifier_length = 63;
     $schema = new Schema($this->connection);
 
-    $statement = $this->getMock('\Drupal\Core\Database\StatementInterface');
+    $statement = $this->getMock(StatementInterface::class);
     $statement->expects($this->any())
       ->method('fetchField')
       ->willReturn($max_identifier_length);
@@ -58,7 +60,7 @@ public function testComputedConstraintName($table_name, $name, $expected) {
     $this->connection->expects($this->at(2))
       ->method('query')
       ->with("SELECT 1 FROM pg_constraint WHERE conname = '$expected'")
-      ->willReturn($this->getMock('\Drupal\Core\Database\StatementInterface'));
+      ->willReturn($this->getMock(StatementInterface::class));
 
     $schema->constraintExists($table_name, $name);
   }
diff --git a/core/tests/Drupal/Tests/Core/Database/OrderByTest.php b/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
index bab2571..4892854 100644
--- a/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Database;
 
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Query\Select;
 use Drupal\Tests\UnitTestCase;
 
@@ -23,7 +24,7 @@ class OrderByTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMockForAbstractClass();
     $this->query = new Select('test', NULL, $connection);
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
index 7dd8e19..108f438 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
@@ -6,9 +6,13 @@
 use Drupal\Core\Datetime\DateFormatter;
 use Drupal\Core\Datetime\FormattedDateDiff;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 
 /**
  * @coversDefaultClass \Drupal\Core\Datetime\DateFormatter
@@ -61,13 +65,13 @@ class DateTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_storage = $this->getMock(EntityStorageInterface::class);
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())->method('getStorage')->with('date_format')->willReturn($entity_storage);
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
-    $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
+    $this->stringTranslation = $this->getMock(TranslationInterface::class);
     $this->requestStack = $this->getMock('Symfony\Component\HttpFoundation\RequestStack');
 
     $config_factory = $this->getConfigFactoryStub(['system.date' => ['country' => ['default' => 'GB']]]);
@@ -78,7 +82,7 @@ protected function setUp() {
 
     $this->dateFormatter = new DateFormatter($this->entityManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack);
 
-    $this->dateFormatterStub = $this->getMockBuilder('\Drupal\Core\Datetime\DateFormatter')
+    $this->dateFormatterStub = $this->getMockBuilder(\Drupal\Core\Datetime\DateFormatter::class)
       ->setConstructorArgs([$this->entityManager, $this->languageManager, $this->stringTranslation, $this->getConfigFactoryStub(), $this->requestStack])
       ->setMethods(['formatDiff'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
index 3f8ca09..1d235bb 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\DependencyInjection\Compiler;
 
+use Drupal\Core\Database\Driver\sqlite\Connection;
 use Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Alias;
@@ -103,7 +104,7 @@ protected function getSqliteContainer($service) {
     $container = new ContainerBuilder();
     $container->setDefinition('service', $service);
     $container->setDefinition('sqlite.service', new Definition(__NAMESPACE__ . '\\ServiceClassSqlite'));
-    $mock = $this->getMockBuilder('Drupal\Core\Database\Driver\sqlite\Connection')->setMethods(NULL)->disableOriginalConstructor()->getMock();
+    $mock = $this->getMockBuilder(Connection::class)->setMethods(NULL)->disableOriginalConstructor()->getMock();
     $container->set('database', $mock);
     return $container;
   }
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
index aea2524..7d055b1 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
@@ -4,6 +4,8 @@
 
 use Drupal\Core\DependencyInjection\Compiler\ProxyServicesPass;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Path\AliasWhitelist;
+use Drupal\Core\Plugin\CachedDiscoveryClearer;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 
@@ -35,12 +37,12 @@ protected function setUp() {
    */
   public function testContainerWithoutLazyServices() {
     $container = new ContainerBuilder();
-    $container->register('plugin_cache_clearer', 'Drupal\Core\Plugin\CachedDiscoveryClearer');
+    $container->register('plugin_cache_clearer', CachedDiscoveryClearer::class);
 
     $this->proxyServicesPass->process($container);
 
     $this->assertCount(1, $container->getDefinitions());
-    $this->assertEquals('Drupal\Core\Plugin\CachedDiscoveryClearer', $container->getDefinition('plugin_cache_clearer')->getClass());
+    $this->assertEquals(CachedDiscoveryClearer::class, $container->getDefinition('plugin_cache_clearer')->getClass());
   }
 
   /**
@@ -48,7 +50,7 @@ public function testContainerWithoutLazyServices() {
    */
   public function testContainerWithLazyServices() {
     $container = new ContainerBuilder();
-    $container->register('plugin_cache_clearer', 'Drupal\Core\Plugin\CachedDiscoveryClearer')
+    $container->register('plugin_cache_clearer', CachedDiscoveryClearer::class)
       ->setLazy(TRUE);
 
     $this->proxyServicesPass->process($container);
@@ -56,11 +58,11 @@ public function testContainerWithLazyServices() {
     $this->assertCount(2, $container->getDefinitions());
 
     $non_proxy_definition = $container->getDefinition('drupal.proxy_original_service.plugin_cache_clearer');
-    $this->assertEquals('Drupal\Core\Plugin\CachedDiscoveryClearer', $non_proxy_definition->getClass());
+    $this->assertEquals(CachedDiscoveryClearer::class, $non_proxy_definition->getClass());
     $this->assertFalse($non_proxy_definition->isLazy());
     $this->assertTrue($non_proxy_definition->isPublic());
 
-    $this->assertEquals('Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer', $container->getDefinition('plugin_cache_clearer')->getClass());
+    $this->assertEquals(\Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer::class, $container->getDefinition('plugin_cache_clearer')->getClass());
   }
 
   /**
@@ -68,7 +70,7 @@ public function testContainerWithLazyServices() {
    */
   public function testContainerWithLazyServicesWithoutProxyClass() {
     $container = new ContainerBuilder();
-    $container->register('alias_whitelist', 'Drupal\Core\Path\AliasWhitelist')
+    $container->register('alias_whitelist', AliasWhitelist::class)
       ->setLazy(TRUE);
 
     $this->setExpectedException(InvalidArgumentException::class);
diff --git a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
index 3729d7e..a8a56f7 100644
--- a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
+++ b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Display;
 
+use Drupal\Core\Display\VariantBase;
 use Drupal\Core\Form\FormState;
 use Drupal\Tests\UnitTestCase;
 
@@ -23,7 +24,7 @@ class DisplayVariantTest extends UnitTestCase {
    *   A mocked display variant plugin.
    */
   public function setUpDisplayVariant($configuration = [], $definition = []) {
-    return $this->getMockBuilder('Drupal\Core\Display\VariantBase')
+    return $this->getMockBuilder(VariantBase::class)
       ->setConstructorArgs([$configuration, 'test', $definition])
       ->setMethods(['build'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
index 7278fd6..f788d0f 100644
--- a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
@@ -36,7 +36,7 @@ public function testTrustedHosts($host, $server_name, $message, $expected = FALS
 
       $request->server->set('SERVER_NAME', $server_name);
 
-      $method = new \ReflectionMethod('Drupal\Core\DrupalKernel', 'setupTrustedHosts');
+      $method = new \ReflectionMethod(DrupalKernel::class, 'setupTrustedHosts');
       $method->setAccessible(TRUE);
       $valid_host = $method->invoke(NULL, $request, $trusted_host_patterns);
 
diff --git a/core/tests/Drupal/Tests/Core/DrupalTest.php b/core/tests/Drupal/Tests/Core/DrupalTest.php
index 2ff6ebf..3652ef4 100644
--- a/core/tests/Drupal/Tests/Core/DrupalTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalTest.php
@@ -2,13 +2,19 @@
 
 namespace Drupal\Tests\Core;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\Query\QueryAggregateInterface;
 use Drupal\Core\Entity\Query\QueryInterface;
+use Drupal\Core\KeyValueStore\KeyValueExpirableFactory;
+use Drupal\Core\KeyValueStore\KeyValueFactory;
+use Drupal\Core\Queue\QueueFactory;
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Url;
+use Drupal\Core\Utility\LinkGeneratorInterface;
 use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
@@ -130,7 +136,7 @@ public function testClassResolver() {
    * @covers ::keyValueExpirable
    */
   public function testKeyValueExpirable() {
-    $keyvalue = $this->getMockBuilder('Drupal\Core\KeyValueStore\KeyValueExpirableFactory')
+    $keyvalue = $this->getMockBuilder(KeyValueExpirableFactory::class)
       ->disableOriginalConstructor()
       ->getMock();
     $keyvalue->expects($this->once())
@@ -158,7 +164,7 @@ public function testLock() {
    * @covers ::config
    */
   public function testConfig() {
-    $config = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config = $this->getMock(ConfigFactoryInterface::class);
     $config->expects($this->once())
       ->method('get')
       ->with('test_config')
@@ -175,7 +181,7 @@ public function testConfig() {
    * @covers ::queue
    */
   public function testQueue() {
-    $queue = $this->getMockBuilder('Drupal\Core\Queue\QueueFactory')
+    $queue = $this->getMockBuilder(QueueFactory::class)
       ->disableOriginalConstructor()
       ->getMock();
     $queue->expects($this->once())
@@ -205,7 +211,7 @@ public function testRequestStack() {
    * @covers ::keyValue
    */
   public function testKeyValue() {
-    $keyvalue = $this->getMockBuilder('Drupal\Core\KeyValueStore\KeyValueFactory')
+    $keyvalue = $this->getMockBuilder(KeyValueFactory::class)
       ->disableOriginalConstructor()
       ->getMock();
     $keyvalue->expects($this->once())
@@ -348,7 +354,7 @@ public function testUrlGenerator() {
   public function testUrl() {
     $route_parameters = ['test_parameter' => 'test'];
     $options = ['test_option' => 'test'];
-    $generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $generator = $this->getMock(UrlGeneratorInterface::class);
     $generator->expects($this->once())
       ->method('generateFromRoute')
       ->with('test_route', $route_parameters, $options)
@@ -377,7 +383,7 @@ public function testLinkGenerator() {
   public function testL() {
     $route_parameters = ['test_parameter' => 'test'];
     $options = ['test_option' => 'test'];
-    $generator = $this->getMock('Drupal\Core\Utility\LinkGeneratorInterface');
+    $generator = $this->getMock(LinkGeneratorInterface::class);
     $url = new Url('test_route', $route_parameters, $options);
     $generator->expects($this->once())
       ->method('generate')
diff --git a/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php b/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
index 064cedf..b7cfe84 100644
--- a/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
+++ b/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Enhancer;
 
+use Drupal\Core\ParamConverter\ParamConverterManagerInterface;
 use Drupal\Core\Routing\Enhancer\ParamConversionEnhancer;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -31,7 +32,7 @@ class ParamConversionEnhancerTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->paramConverterManager = $this->getMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface');
+    $this->paramConverterManager = $this->getMock(ParamConverterManagerInterface::class);
     $this->paramConversionEnhancer = new ParamConversionEnhancer($this->paramConverterManager);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
index 616f6ba..5f1b261 100644
--- a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
@@ -3,8 +3,13 @@
 namespace Drupal\Tests\Core\Entity;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\ContentEntityBase;
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\Field\FieldItemList;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldTypePluginManagerInterface;
+use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -35,7 +40,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
    */
   protected function setUp() {
     // Mock the field type manager and place it in the container.
-    $field_type_manager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $field_type_manager = $this->getMock(FieldTypePluginManagerInterface::class);
 
     $this->fieldType = $this->randomMachineName();
     $this->fieldTypeDefinition = [
@@ -161,20 +166,20 @@ public function testFieldDefaultValue() {
     ];
     $expected_default_value = [$default_value];
     $definition->setDefaultValue($default_value);
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->getMock();
     // Set the field item list class to be used to avoid requiring the typed
     // data manager to retrieve it.
-    $definition->setClass('Drupal\Core\Field\FieldItemList');
+    $definition->setClass(FieldItemList::class);
     $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity));
 
-    $data_definition = $this->getMockBuilder('Drupal\Core\TypedData\DataDefinition')
+    $data_definition = $this->getMockBuilder(DataDefinition::class)
       ->disableOriginalConstructor()
       ->getMock();
     $data_definition->expects($this->any())
       ->method('getClass')
-      ->will($this->returnValue('Drupal\Core\Field\FieldItemBase'));
+      ->will($this->returnValue(FieldItemBase::class));
     $definition->setItemDefinition($data_definition);
 
     // Set default value only with a literal.
@@ -207,20 +212,20 @@ public function testFieldInitialValue() {
     ];
     $expected_default_value = [$default_value];
     $definition->setInitialValue($default_value);
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->getMock();
     // Set the field item list class to be used to avoid requiring the typed
     // data manager to retrieve it.
-    $definition->setClass('Drupal\Core\Field\FieldItemList');
+    $definition->setClass(FieldItemList::class);
     $this->assertEquals($expected_default_value, $definition->getInitialValue($entity));
 
-    $data_definition = $this->getMockBuilder('Drupal\Core\TypedData\DataDefinition')
+    $data_definition = $this->getMockBuilder(DataDefinition::class)
       ->disableOriginalConstructor()
       ->getMock();
     $data_definition->expects($this->any())
       ->method('getClass')
-      ->will($this->returnValue('Drupal\Core\Field\FieldItemBase'));
+      ->will($this->returnValue(FieldItemBase::class));
     $definition->setItemDefinition($data_definition);
 
     // Set default value only with a literal.
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
index 541ec88..5773b80 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@@ -2,10 +2,25 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\ContentEntityBase;
+use \Drupal\Core\Entity\EntityAccessControlHandlerInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityStorageInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
+use \Drupal\Core\Field\FieldItemBase;
+use \Drupal\Core\Field\FieldItemList;
+use \Drupal\Core\Field\FieldTypePluginManager;
+use \Drupal\Core\Language\LanguageManagerInterface;
+use \Symfony\Component\Validator\ConstraintViolationInterface;
+use \Symfony\Component\Validator\ConstraintViolationList;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
 use Drupal\Tests\UnitTestCase;
@@ -116,7 +131,7 @@ protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
     $this->bundle = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getKeys')
       ->will($this->returnValue([
@@ -124,23 +139,23 @@ protected function setUp() {
         'uuid' => 'uuid',
     ]));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $this->typedDataManager = $this->getMock(TypedDataManagerInterface::class);
     $this->typedDataManager->expects($this->any())
       ->method('getDefinition')
       ->with('entity')
-      ->will($this->returnValue(['class' => '\Drupal\Core\Entity\Plugin\DataType\EntityAdapter']));
+      ->will($this->returnValue(['class' => EntityAdapter::class]));
 
     $english = new Language(['id' => 'en']);
     $not_specified = new Language(['id' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'locked' => TRUE]);
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getLanguages')
       ->will($this->returnValue(['en' => $english, LanguageInterface::LANGCODE_NOT_SPECIFIED => $not_specified]));
@@ -153,7 +168,7 @@ protected function setUp() {
       ->with(LanguageInterface::LANGCODE_NOT_SPECIFIED)
       ->will($this->returnValue($not_specified));
 
-    $this->fieldTypePluginManager = $this->getMockBuilder('\Drupal\Core\Field\FieldTypePluginManager')
+    $this->fieldTypePluginManager = $this->getMockBuilder(FieldTypePluginManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->fieldTypePluginManager->expects($this->any())
@@ -164,7 +179,7 @@ protected function setUp() {
       ->will($this->returnValue([]));
     $this->fieldTypePluginManager->expects($this->any())
       ->method('createFieldItemList')
-      ->will($this->returnValue($this->getMock('Drupal\Core\Field\FieldItemListInterface')));
+      ->will($this->returnValue($this->getMock(FieldItemListInterface::class)));
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -184,9 +199,9 @@ protected function setUp() {
       ->with($this->entityTypeId, $this->bundle)
       ->will($this->returnValue($this->fieldDefinitions));
 
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\ContentEntityBase', [$values, $this->entityTypeId, $this->bundle], '', TRUE, TRUE, TRUE, ['isNew']);
+    $this->entity = $this->getMockForAbstractClass(ContentEntityBase::class, [$values, $this->entityTypeId, $this->bundle], '', TRUE, TRUE, TRUE, ['isNew']);
     $values['defaultLangcode'] = [LanguageInterface::LANGCODE_DEFAULT => LanguageInterface::LANGCODE_NOT_SPECIFIED];
-    $this->entityUnd = $this->getMockForAbstractClass('\Drupal\Core\Entity\ContentEntityBase', [$values, $this->entityTypeId, $this->bundle]);
+    $this->entityUnd = $this->getMockForAbstractClass(ContentEntityBase::class, [$values, $this->entityTypeId, $this->bundle]);
   }
 
   /**
@@ -221,10 +236,10 @@ public function testIsNewRevision() {
       ->with('revision')
       ->will($this->returnValue('revision_id'));
 
-    $field_item_list = $this->getMockBuilder('\Drupal\Core\Field\FieldItemList')
+    $field_item_list = $this->getMockBuilder(FieldItemList::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $field_item = $this->getMockBuilder('\Drupal\Core\Field\FieldItemBase')
+    $field_item = $this->getMockBuilder(FieldItemBase::class)
       ->disableOriginalConstructor()
       ->getMockForAbstractClass();
 
@@ -318,7 +333,7 @@ public function testIsTranslatableForMonolingual() {
    */
   public function testPreSaveRevision() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $record = new \stdClass();
     // Our mocked entity->preSaveRevision() returns NULL, so assert that.
     $this->assertNull($this->entity->preSaveRevision($storage, $record));
@@ -330,11 +345,11 @@ public function testPreSaveRevision() {
   public function testValidate() {
     $validator = $this->getMock(ValidatorInterface::class);
     /** @var \Symfony\Component\Validator\ConstraintViolationList|\PHPUnit_Framework_MockObject_MockObject $empty_violation_list */
-    $empty_violation_list = $this->getMockBuilder('\Symfony\Component\Validator\ConstraintViolationList')
+    $empty_violation_list = $this->getMockBuilder(ConstraintViolationList::class)
       ->setMethods(NULL)
       ->getMock();
     $non_empty_violation_list = clone $empty_violation_list;
-    $violation = $this->getMock('\Symfony\Component\Validator\ConstraintViolationInterface');
+    $violation = $this->getMock(ConstraintViolationInterface::class);
     $non_empty_violation_list->add($violation);
     $validator->expects($this->at(0))
       ->method('validate')
@@ -363,7 +378,7 @@ public function testValidate() {
   public function testRequiredValidation() {
     $validator = $this->getMock(ValidatorInterface::class);
     /** @var \Symfony\Component\Validator\ConstraintViolationList|\PHPUnit_Framework_MockObject_MockObject $empty_violation_list */
-    $empty_violation_list = $this->getMockBuilder('\Symfony\Component\Validator\ConstraintViolationList')
+    $empty_violation_list = $this->getMockBuilder(ConstraintViolationList::class)
       ->setMethods(NULL)
       ->getMock();
     $validator->expects($this->at(0))
@@ -375,7 +390,7 @@ public function testRequiredValidation() {
       ->will($this->returnValue($validator));
 
     /** @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject $storage */
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->any())
       ->method('save')
       ->willReturnCallback(function (ContentEntityInterface $entity) use ($storage) {
@@ -418,7 +433,7 @@ public function testBundle() {
    * @covers ::access
    */
   public function testAccess() {
-    $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface');
+    $access = $this->getMock(EntityAccessControlHandlerInterface::class);
     $operation = $this->randomMachineName();
     $access->expects($this->at(0))
       ->method('access')
@@ -488,7 +503,7 @@ public function providerGet() {
    */
   public function testGet($expected, $field_name, $active_langcode, $fields) {
     // Mock ContentEntityBase.
-    $mock_base = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $mock_base = $this->getMockBuilder(\Drupal\Core\Entity\ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->setMethods(['getTranslatedField'])
       ->getMockForAbstractClass();
@@ -550,7 +565,7 @@ public function providerGetFields() {
    */
   public function testGetFields($expected, $include_computed, $is_computed, $field_definitions) {
     // Mock ContentEntityBase.
-    $mock_base = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $mock_base = $this->getMockBuilder(\Drupal\Core\Entity\ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->setMethods(['getFieldDefinitions', 'get'])
       ->getMockForAbstractClass();
@@ -558,7 +573,7 @@ public function testGetFields($expected, $include_computed, $is_computed, $field
     // Mock field definition objects for each element of $field_definitions.
     $mocked_field_definitions = [];
     foreach ($field_definitions as $name) {
-      $mock_definition = $this->getMockBuilder('Drupal\Core\Field\FieldDefinitionInterface')
+      $mock_definition = $this->getMockBuilder(FieldDefinitionInterface::class)
         ->setMethods(['isComputed'])
         ->getMockForAbstractClass();
       // Set expectations for isComputed(). isComputed() gets called whenever
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
index 4afbfe1..5f3ce98 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use \Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Entity\EntityConstraintViolationList;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -19,7 +20,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
    * @covers ::filterByFields
    */
   public function testFilterByFields() {
-    $account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
+    $account = $this->prophesize(\Drupal\Core\Session\AccountInterface::class)->reveal();
     $entity = $this->setupEntity($account);
 
     $constraint_list = $this->setupConstraintListWithoutCompositeConstraint($entity);
@@ -34,7 +35,7 @@ public function testFilterByFields() {
    * @covers ::filterByFields
    */
   public function testFilterByFieldsWithCompositeConstraints() {
-    $account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
+    $account = $this->prophesize(\Drupal\Core\Session\AccountInterface::class)->reveal();
     $entity = $this->setupEntity($account);
 
     $constraint_list = $this->setupConstraintListWithCompositeConstraint($entity);
@@ -49,7 +50,7 @@ public function testFilterByFieldsWithCompositeConstraints() {
    * @covers ::filterByFieldAccess
    */
   public function testFilterByFieldAccess() {
-    $account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
+    $account = $this->prophesize(\Drupal\Core\Session\AccountInterface::class)->reveal();
     $entity = $this->setupEntity($account);
 
     $constraint_list = $this->setupConstraintListWithoutCompositeConstraint($entity);
@@ -64,7 +65,7 @@ public function testFilterByFieldAccess() {
    * @covers ::filterByFieldAccess
    */
   public function testFilterByFieldAccessWithCompositeConstraint() {
-    $account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
+    $account = $this->prophesize(\Drupal\Core\Session\AccountInterface::class)->reveal();
     $entity = $this->setupEntity($account);
 
     $constraint_list = $this->setupConstraintListWithCompositeConstraint($entity);
@@ -85,17 +86,17 @@ public function testFilterByFieldAccessWithCompositeConstraint() {
    *   A fieldable entity.
    */
   protected function setupEntity(AccountInterface $account) {
-    $prophecy = $this->prophesize('\Drupal\Core\Field\FieldItemListInterface');
+    $prophecy = $this->prophesize(FieldItemListInterface::class);
     $prophecy->access('edit', $account)
       ->willReturn(FALSE);
     $name_field_item_list = $prophecy->reveal();
 
-    $prophecy = $this->prophesize('\Drupal\Core\Field\FieldItemListInterface');
+    $prophecy = $this->prophesize(FieldItemListInterface::class);
     $prophecy->access('edit', $account)
       ->willReturn(TRUE);
     $type_field_item_list = $prophecy->reveal();
 
-    $prophecy = $this->prophesize('\Drupal\Core\Entity\FieldableEntityInterface');
+    $prophecy = $this->prophesize(\Drupal\Core\Entity\FieldableEntityInterface::class);
     $prophecy->hasField('name')
       ->willReturn(TRUE);
     $prophecy->hasField('type')
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
index 2c3d132..7ba19a4 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
@@ -5,7 +5,11 @@
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\Container;
+use Drupal\Core\Entity\EntityAccessControlHandlerInterface;
 use Drupal\Core\Entity\EntityCreateAccessCheck;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
 
@@ -75,12 +79,12 @@ public function testAccess($entity_bundle, $requirement, $access, $expected, $ex
       $expected_access_result->cachePerPermissions();
     }
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
 
     // Don't expect a call to the access control handler when we have a bundle
     // argument requirement but no bundle is provided.
     if ($entity_bundle || strpos($requirement, '{') === FALSE) {
-      $access_control_handler = $this->getMock('Drupal\Core\Entity\EntityAccessControlHandlerInterface');
+      $access_control_handler = $this->getMock(EntityAccessControlHandlerInterface::class);
       $access_control_handler->expects($this->once())
         ->method('createAccess')
         ->with($entity_bundle)
@@ -106,12 +110,12 @@ public function testAccess($entity_bundle, $requirement, $access, $expected, $ex
       $raw_variables->set('bundle_argument', $entity_bundle);
     }
 
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $route_match->expects($this->any())
       ->method('getRawParameters')
       ->will($this->returnValue($raw_variables));
 
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $this->assertEquals($expected_access_result, $applies_check->access($route, $route_match, $account));
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
index 963c1a1..eb3d15c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
@@ -3,6 +3,11 @@
 namespace Drupal\Tests\Core\Entity;
 
 use Drupal\Core\Entity\EntityFormBuilder;
+use Drupal\Core\Entity\EntityFormInterface;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Form\FormBuilderInterface;
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -38,8 +43,8 @@ class EntityFormBuilderTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->formBuilder = $this->getMock('Drupal\Core\Form\FormBuilderInterface');
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->formBuilder = $this->getMock(FormBuilderInterface::class);
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityFormBuilder = new EntityFormBuilder($this->entityManager, $this->formBuilder);
   }
 
@@ -49,7 +54,7 @@ protected function setUp() {
    * @covers ::getForm
    */
   public function testGetForm() {
-    $form_controller = $this->getMock('Drupal\Core\Entity\EntityFormInterface');
+    $form_controller = $this->getMock(EntityFormInterface::class);
     $form_controller->expects($this->any())
       ->method('getFormId')
       ->will($this->returnValue('the_form_id'));
@@ -60,10 +65,10 @@ public function testGetForm() {
 
     $this->formBuilder->expects($this->once())
       ->method('buildForm')
-      ->with($form_controller, $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'))
+      ->with($form_controller, $this->isInstanceOf(FormStateInterface::class))
       ->will($this->returnValue('the form contents'));
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->once())
       ->method('getEntityTypeId')
       ->will($this->returnValue('the_entity_type'));
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
index 4bed37d..fc6a3d3 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -52,7 +53,7 @@ protected function setUp() {
   public function testFormId($expected, $definition) {
     $this->entityType->set('entity_keys', ['bundle' => $definition['bundle']]);
 
-    $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [[], $definition['entity_type']], '', TRUE, TRUE, TRUE, ['getEntityType', 'bundle']);
+    $entity = $this->getMockForAbstractClass(Entity::class, [[], $definition['entity_type']], '', TRUE, TRUE, TRUE, ['getEntityType', 'bundle']);
 
     $entity->expects($this->any())
       ->method('getEntityType')
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
index 60bd425..e5d02ff 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
@@ -3,8 +3,13 @@
 namespace Drupal\Tests\Core\Entity;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\Entity;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Link;
+use Drupal\Core\Utility\LinkGeneratorInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -40,9 +45,9 @@ class EntityLinkTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->linkGenerator = $this->getMock('Drupal\Core\Utility\LinkGeneratorInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->linkGenerator = $this->getMock(LinkGeneratorInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -75,7 +80,7 @@ public function testLink($entity_label, $link_text, $expected_text, $link_rel =
     $entity_type_id = 'test_entity_type';
     $expected = '<a href="/test_entity_type/test_entity_id">' . $expected_text . '</a>';
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('getLinkTemplates')
       ->willReturn($route_name_map);
@@ -93,7 +98,7 @@ public function testLink($entity_label, $link_text, $expected_text, $link_rel =
       ->will($this->returnValue($entity_type));
 
     /** @var \Drupal\Core\Entity\Entity $entity */
-    $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [
+    $entity = $this->getMockForAbstractClass(Entity::class, [
       ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'],
       $entity_type_id,
     ]);
@@ -137,7 +142,7 @@ public function testToLink($entity_label, $link_text, $expected_text, $link_rel
     $entity_type_id = 'test_entity_type';
     $expected = '<a href="/test_entity_type/test_entity_id">' . $expected_text . '</a>';
 
-    $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->once())
       ->method('getLinkTemplates')
       ->willReturn($route_name_map);
@@ -155,7 +160,7 @@ public function testToLink($entity_label, $link_text, $expected_text, $link_rel
       ->will($this->returnValue($entity_type));
 
     /** @var \Drupal\Core\Entity\Entity $entity */
-    $entity = $this->getMockForAbstractClass('Drupal\Core\Entity\Entity', [
+    $entity = $this->getMockForAbstractClass(Entity::class, [
       ['id' => $entity_id, 'label' => $entity_label, 'langcode' => 'es'],
       $entity_type_id,
     ]);
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
index 44e771c..9d5499e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
@@ -7,6 +7,10 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use \Drupal\Core\Url;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Extension\ModuleHandlerInterface;
+use \Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\EntityInterface;
@@ -77,9 +81,9 @@ protected function setUp() {
 
     $this->role = $this->getMock('Drupal\user\RoleInterface');
     $this->roleStorage = $this->getMock('\Drupal\user\RoleStorageInterface');
-    $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
-    $this->translationManager = $this->getMock('\Drupal\Core\StringTranslation\TranslationInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
+    $this->translationManager = $this->getMock(TranslationInterface::class);
     $this->entityListBuilder = new TestEntityListBuilder($this->entityType, $this->roleStorage, $this->moduleHandler);
     $this->container = new ContainerBuilder();
     \Drupal::setContainer($this->container);
@@ -111,7 +115,7 @@ public function testGetOperations() {
     $this->role->expects($this->any())
       ->method('hasLinkTemplate')
       ->will($this->returnValue(TRUE));
-    $url = $this->getMockBuilder('\Drupal\Core\Url')
+    $url = $this->getMockBuilder(Url::class)
       ->disableOriginalConstructor()
       ->getMock();
     $url->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
index d2e5eae..259e069 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
@@ -9,7 +9,9 @@
 
 use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityResolverManager;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormStateInterface;
@@ -56,7 +58,7 @@ class EntityResolverManagerTest extends UnitTestCase {
    * @covers ::__construct
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
     $this->classResolver = $this->getClassResolverStub();
 
@@ -441,7 +443,7 @@ public function testSetRouteOptionsWithEntityAddFormRoute() {
    * Creates the entity manager mock returning entity type objects.
    */
   protected function setupEntityTypes() {
-    $definition = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $definition = $this->getMock(EntityTypeInterface::class);
     $definition->expects($this->any())
       ->method('getClass')
       ->will($this->returnValue('Drupal\Tests\Core\Entity\SimpleTestEntity'));
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
index d1045f5..b7a904d 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@@ -2,8 +2,10 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use Drupal\Core\Entity\EntityHandlerBase;
 use Drupal\Core\Entity\EntityType;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\Exception\EntityTypeIdLengthException;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\Tests\UnitTestCase;
 
@@ -46,7 +48,7 @@ public function testGet(array $defintion, $key, $expected) {
    */
   public function testSet($key, $value) {
     $entity_type = $this->setUpEntityType([]);
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityTypeInterface', $entity_type->set($key, $value));
+    $this->assertInstanceOf(EntityTypeInterface::class, $entity_type->set($key, $value));
     $this->assertSame($value, $entity_type->get($key));
     $this->assertNoPublicProperties($entity_type);
   }
@@ -255,7 +257,7 @@ public function testGetViewBuilderClass() {
   public function testIdExceedsMaxLength() {
     $id = $this->randomMachineName(33);
     $message = 'Attempt to create an entity type with an ID longer than 32 characters: ' . $id;
-    $this->setExpectedException('Drupal\Core\Entity\Exception\EntityTypeIdLengthException', $message);
+    $this->setExpectedException(EntityTypeIdLengthException::class, $message);
     $this->setUpEntityType(['id' => $id]);
   }
 
@@ -395,7 +397,7 @@ public function testGetCountLabelDefault() {
    *   A mock controller class name.
    */
   protected function getTestHandlerClass() {
-    return get_class($this->getMockForAbstractClass('Drupal\Core\Entity\EntityHandlerBase'));
+    return get_class($this->getMockForAbstractClass(EntityHandlerBase::class));
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
index ad9e49c..1e2a022 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
@@ -2,8 +2,17 @@
 
 namespace Drupal\Tests\Core\Entity;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\Entity;
+use \Drupal\Core\Entity\EntityAccessControlHandlerInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityStorageInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\CacheTagsInvalidator;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\Language;
 use Drupal\Tests\UnitTestCase;
@@ -89,26 +98,26 @@ protected function setUp() {
     ];
     $this->entityTypeId = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getListCacheTags')
       ->willReturn([$this->entityTypeId . '_list']);
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getLanguage')
       ->with('en')
       ->will($this->returnValue(new Language(['id' => 'en'])));
 
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidator');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidator::class);
 
     $container = new ContainerBuilder();
     $container->set('entity.manager', $this->entityManager);
@@ -117,7 +126,7 @@ protected function setUp() {
     $container->set('cache_tags.invalidator', $this->cacheTagsInvalidator);
     \Drupal::setContainer($container);
 
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\Entity', [$this->values, $this->entityTypeId]);
+    $this->entity = $this->getMockForAbstractClass(Entity::class, [$this->values, $this->entityTypeId]);
   }
 
   /**
@@ -204,7 +213,7 @@ public function testLabel() {
    * @covers ::access
    */
   public function testAccess() {
-    $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface');
+    $access = $this->getMock(EntityAccessControlHandlerInterface::class);
     $operation = $this->randomMachineName();
     $access->expects($this->at(0))
       ->method('access')
@@ -265,7 +274,7 @@ public function testLoad() {
       ->with($class_name)
       ->willReturn($this->entityTypeId);
 
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('load')
       ->with(1)
@@ -295,7 +304,7 @@ public function testLoadMultiple() {
       ->with($class_name)
       ->willReturn($this->entityTypeId);
 
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('loadMultiple')
       ->with([1])
@@ -322,7 +331,7 @@ public function testCreate() {
       ->with($class_name)
       ->willReturn($this->entityTypeId);
 
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('create')
       ->with([])
@@ -341,7 +350,7 @@ public function testCreate() {
    * @covers ::save
    */
   public function testSave() {
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('save')
       ->with($this->entity);
@@ -357,7 +366,7 @@ public function testSave() {
    */
   public function testDelete() {
     $this->entity->id = $this->randomMachineName();
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     // Testing the argument of the delete() method consumes too much memory.
     $storage->expects($this->once())
       ->method('delete');
@@ -380,7 +389,7 @@ public function testGetEntityTypeId() {
    */
   public function testPreSave() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     // Our mocked entity->preSave() returns NULL, so assert that.
     $this->assertNull($this->entity->preSave($storage));
   }
@@ -402,7 +411,7 @@ public function testPostSave() {
       ]);
 
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
 
     // A creation should trigger the invalidation of the "list" cache tag.
     $this->entity->postSave($storage, FALSE);
@@ -416,7 +425,7 @@ public function testPostSave() {
    */
   public function testPreCreate() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $values = [];
     // Our mocked entity->preCreate() returns NULL, so assert that.
     $this->assertNull($this->entity->preCreate($storage, $values));
@@ -427,7 +436,7 @@ public function testPreCreate() {
    */
   public function testPostCreate() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     // Our mocked entity->postCreate() returns NULL, so assert that.
     $this->assertNull($this->entity->postCreate($storage));
   }
@@ -437,7 +446,7 @@ public function testPostCreate() {
    */
   public function testPreDelete() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     // Our mocked entity->preDelete() returns NULL, so assert that.
     $this->assertNull($this->entity->preDelete($storage, [$this->entity]));
   }
@@ -452,7 +461,7 @@ public function testPostDelete() {
         $this->entityTypeId . ':' . $this->values['id'],
         $this->entityTypeId . '_list',
       ]);
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $storage->expects($this->once())
       ->method('getEntityType')
       ->willReturn($this->entityType);
@@ -466,7 +475,7 @@ public function testPostDelete() {
    */
   public function testPostLoad() {
     // This method is internal, so check for errors on calling it only.
-    $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface');
+    $storage = $this->getMock(EntityStorageInterface::class);
     $entities = [$this->entity];
     // Our mocked entity->postLoad() returns NULL, so assert that.
     $this->assertNull($this->entity->postLoad($storage, $entities));
@@ -506,7 +515,7 @@ public function testCacheTags() {
    * @covers ::addCacheContexts
    */
   public function testCacheContexts() {
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
index 6f20444..7a8e0b5 100644
--- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
@@ -2,14 +2,24 @@
 
 namespace Drupal\Tests\Core\Entity\KeyValueStore;
 
+use Drupal\Component\Uuid\UuidInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityMalformedException;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityStorageException;
+use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * @coversDefaultClass \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage
@@ -76,7 +86,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->entityType = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
   }
 
   /**
@@ -102,18 +112,18 @@ protected function setUpKeyValueEntityStorage($uuid_key = 'uuid') {
       ->method('getListCacheTags')
       ->willReturn(['test_entity_type_list']);
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with('test_entity_type')
       ->will($this->returnValue($this->entityType));
 
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
-    $this->keyValueStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->uuidService = $this->getMock('Drupal\Component\Uuid\UuidInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->keyValueStore = $this->getMock(KeyValueStoreInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->uuidService = $this->getMock(UuidInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $language = new Language(['langcode' => 'en']);
     $this->languageManager->expects($this->any())
       ->method('getDefaultLanguage')
@@ -152,7 +162,7 @@ public function testCreateWithPredefinedUuid() {
       ->method('generate');
 
     $entity = $this->entityStorage->create(['id' => 'foo', 'uuid' => 'baz']);
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+    $this->assertInstanceOf(EntityInterface::class, $entity);
     $this->assertSame('foo', $entity->id());
     $this->assertSame('baz', $entity->uuid());
   }
@@ -178,7 +188,7 @@ public function testCreateWithoutUuidKey() {
       ->method('generate');
 
     $entity = $this->entityStorage->create(['id' => 'foo', 'uuid' => 'baz']);
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+    $this->assertInstanceOf(EntityInterface::class, $entity);
     $this->assertSame('foo', $entity->id());
     $this->assertSame('baz', $entity->uuid());
   }
@@ -190,7 +200,7 @@ public function testCreateWithoutUuidKey() {
    * @return \Drupal\Core\Entity\EntityInterface
    */
   public function testCreate() {
-    $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [], ['toArray']);
+    $entity = $this->getMockEntity(Entity::class, [], ['toArray']);
     $this->entityType->expects($this->once())
       ->method('getClass')
       ->will($this->returnValue(get_class($entity)));
@@ -207,7 +217,7 @@ public function testCreate() {
       ->will($this->returnValue('bar'));
 
     $entity = $this->entityStorage->create(['id' => 'foo']);
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+    $this->assertInstanceOf(EntityInterface::class, $entity);
     $this->assertSame('foo', $entity->id());
     $this->assertSame('bar', $entity->uuid());
     return $entity;
@@ -326,7 +336,7 @@ public function testSaveUpdate(EntityInterface $entity) {
   public function testSaveConfigEntity() {
     $this->setUpKeyValueEntityStorage();
 
-    $entity = $this->getMockEntity('Drupal\Core\Config\Entity\ConfigEntityBase', [['id' => 'foo']], [
+    $entity = $this->getMockEntity(ConfigEntityBase::class, [['id' => 'foo']], [
       'toArray',
       'preSave',
     ]);
@@ -425,7 +435,7 @@ public function testSaveContentEntity() {
       ->with('foo', $expected);
     $this->keyValueStore->expects($this->never())
       ->method('delete');
-    $entity = $this->getMockEntity('Drupal\Core\Entity\ContentEntityBase', [], [
+    $entity = $this->getMockEntity(ContentEntityBase::class, [], [
       'toArray',
       'id',
     ]);
@@ -445,7 +455,7 @@ public function testSaveContentEntity() {
   public function testSaveInvalid() {
     $this->setUpKeyValueEntityStorage();
 
-    $entity = $this->getMockEntity('Drupal\Core\Config\Entity\ConfigEntityBase');
+    $entity = $this->getMockEntity(ConfigEntityBase::class);
     $this->keyValueStore->expects($this->never())
       ->method('has');
     $this->keyValueStore->expects($this->never())
@@ -463,7 +473,7 @@ public function testSaveInvalid() {
   public function testSaveDuplicate() {
     $this->setUpKeyValueEntityStorage();
 
-    $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]);
+    $entity = $this->getMockEntity(Entity::class, [['id' => 'foo']]);
     $entity->enforceIsNew();
     $this->keyValueStore->expects($this->once())
       ->method('has')
@@ -500,7 +510,7 @@ public function testLoad() {
       ->with('test_entity_type_load')
       ->will($this->returnValue([]));
     $entity = $this->entityStorage->load('foo');
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+    $this->assertInstanceOf(EntityInterface::class, $entity);
     $this->assertSame('foo', $entity->id());
   }
 
@@ -529,8 +539,8 @@ public function testLoadMissingEntity() {
    * @covers ::doLoadMultiple
    */
   public function testLoadMultipleAll() {
-    $expected['foo'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]);
-    $expected['bar'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'bar']]);
+    $expected['foo'] = $this->getMockEntity(Entity::class, [['id' => 'foo']]);
+    $expected['bar'] = $this->getMockEntity(Entity::class, [['id' => 'bar']]);
     $this->entityType->expects($this->once())
       ->method('getClass')
       ->will($this->returnValue(get_class(reset($expected))));
@@ -549,7 +559,7 @@ public function testLoadMultipleAll() {
       ->will($this->returnValue([]));
     $entities = $this->entityStorage->loadMultiple();
     foreach ($entities as $id => $entity) {
-      $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+      $this->assertInstanceOf(EntityInterface::class, $entity);
       $this->assertSame($id, $entity->id());
       $this->assertSame($id, $expected[$id]->id());
     }
@@ -562,7 +572,7 @@ public function testLoadMultipleAll() {
    * @covers ::doLoadMultiple
    */
   public function testLoadMultipleIds() {
-    $entity = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]);
+    $entity = $this->getMockEntity(Entity::class, [['id' => 'foo']]);
     $this->entityType->expects($this->once())
       ->method('getClass')
       ->will($this->returnValue(get_class($entity)));
@@ -583,7 +593,7 @@ public function testLoadMultipleIds() {
       ->will($this->returnValue([]));
     $entities = $this->entityStorage->loadMultiple(['foo']);
     foreach ($entities as $id => $entity) {
-      $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+      $this->assertInstanceOf(EntityInterface::class, $entity);
       $this->assertSame($id, $entity->id());
     }
   }
@@ -611,8 +621,8 @@ public function testDeleteRevision() {
    * @covers ::doDelete
    */
   public function testDelete() {
-    $entities['foo'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'foo']]);
-    $entities['bar'] = $this->getMockEntity('Drupal\Core\Entity\Entity', [['id' => 'bar']]);
+    $entities['foo'] = $this->getMockEntity(Entity::class, [['id' => 'foo']]);
+    $entities['bar'] = $this->getMockEntity(Entity::class, [['id' => 'bar']]);
     $this->entityType->expects($this->once())
       ->method('getClass')
       ->will($this->returnValue(get_class(reset($entities))));
@@ -680,7 +690,7 @@ public function testDeleteNothing() {
    *
    * @return \Drupal\Core\Entity\EntityInterface|\PHPUnit_Framework_MockObject_MockObject
    */
-  public function getMockEntity($class = 'Drupal\Core\Entity\Entity', array $arguments = [], $methods = []) {
+  public function getMockEntity($class = Entity::class, array $arguments = [], $methods = []) {
     // Ensure the entity is passed at least an array of values and an entity
     // type ID
     if (!isset($arguments[0])) {
diff --git a/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php b/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
index 850e4b4..c8a0f45 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Entity\Query\Sql;
 
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityType;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Entity\Query\QueryException;
@@ -27,7 +28,7 @@ protected function setUp() {
     parent::setUp();
     $entity_type = new EntityType(['id' => 'example_entity_query']);
     $conjunction = 'AND';
-    $connection = $this->getMockBuilder('Drupal\Core\Database\Connection')->disableOriginalConstructor()->getMock();
+    $connection = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->getMock();
     $namespaces = ['Drupal\Core\Entity\Query\Sql'];
 
     $this->query = new Query($entity_type, $conjunction, $connection, $namespaces);
diff --git a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
index 7e853bc..aab4b66 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
+use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
@@ -141,7 +142,7 @@ public function providerTestGetAddFormRoute() {
     $data['no_add_form_no_bundle'] = [clone $route, $entity_type2->reveal()];
 
     $entity_type3 = $this->getEntityType($entity_type2);
-    $entity_type3->getFormClass('add')->willReturn('Drupal\Core\Entity\EntityForm');
+    $entity_type3->getFormClass('add')->willReturn(EntityForm::class);
     $route->setDefault('_entity_form', 'the_entity_type_id.add');
     $data['add_form_no_bundle'] = [clone $route, $entity_type3->reveal()];
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
index 39c9a05..e9ce4a3 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\Core\Entity\Sql;
 
+use \Drupal\Core\Entity\ContentEntityTypeInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\Sql\SqlContentEntityStorage;
+use \Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Entity\Sql\DefaultTableMapping;
 use Drupal\Core\Entity\Sql\SqlContentEntityStorageException;
 use Drupal\Tests\UnitTestCase;
@@ -25,7 +29,7 @@ class DefaultTableMappingTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\ContentEntityTypeInterface');
+    $this->entityType = $this->getMock(ContentEntityTypeInterface::class);
     $this->entityType
       ->expects($this->any())
       ->method('id')
@@ -362,7 +366,7 @@ public function testGetFieldTableName($table_names, $expected) {
       ->method('getColumns')
       ->willReturn($columns);
 
-    $storage = $this->getMockBuilder('\Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -381,13 +385,13 @@ public function testGetFieldTableName($table_names, $expected) {
       ->method('getRevisionTable')
       ->willReturn(isset($table_names['revision']) ? $table_names['revision'] : NULL);
 
-    $entity_manager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager
       ->expects($this->any())
       ->method('getStorage')
       ->willReturn($storage);
 
-    $container = $this->getMock('\Symfony\Component\DependencyInjection\ContainerInterface');
+    $container = $this->getMock(ContainerInterface::class);
     $container
       ->expects($this->any())
       ->method('get')
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index aecc3e4..dc86b21 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -2,9 +2,17 @@
 
 namespace Drupal\Tests\Core\Entity\Sql;
 
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Schema;
 use Drupal\Core\Entity\ContentEntityType;
 use Drupal\Core\Entity\ContentEntityTypeInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Sql\DefaultTableMapping;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
+use Drupal\Core\TypedData\DataDefinitionInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -59,8 +67,8 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -1115,25 +1123,25 @@ public function testDedicatedTableSchemaForEntityWithStringIdentifier() {
   }
 
   public function providerTestRequiresEntityDataMigration() {
-    $updated_entity_type_definition = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $updated_entity_type_definition = $this->getMock(EntityTypeInterface::class);
     $updated_entity_type_definition->expects($this->any())
       ->method('getStorageClass')
       // A class that exists, *any* class.
-      ->willReturn('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema');
-    $original_entity_type_definition = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+      ->willReturn(SqlContentEntityStorageSchema::class);
+    $original_entity_type_definition = $this->getMock(EntityTypeInterface::class);
     $original_entity_type_definition->expects($this->any())
       ->method('getStorageClass')
       // A class that exists, *any* class.
-      ->willReturn('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema');
-    $original_entity_type_definition_other_nonexisting = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+      ->willReturn(SqlContentEntityStorageSchema::class);
+    $original_entity_type_definition_other_nonexisting = $this->getMock(EntityTypeInterface::class);
     $original_entity_type_definition_other_nonexisting->expects($this->any())
       ->method('getStorageClass')
       ->willReturn('bar');
-    $original_entity_type_definition_other_existing = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $original_entity_type_definition_other_existing = $this->getMock(EntityTypeInterface::class);
     $original_entity_type_definition_other_existing->expects($this->any())
       ->method('getStorageClass')
       // A class that exists, *any* class.
-      ->willReturn('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema');
+      ->willReturn(SqlContentEntityStorageSchema::class);
 
     return [
       // Case 1: same storage class, ::hasData() === TRUE.
@@ -1167,7 +1175,7 @@ public function testRequiresEntityDataMigration($updated_entity_type_definition,
       'entity_keys' => ['id' => 'id'],
     ]);
 
-    $original_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $original_storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -1179,7 +1187,7 @@ public function testRequiresEntityDataMigration($updated_entity_type_definition,
     $this->storage->expects($this->never())
       ->method('hasData');
 
-    $connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -1187,7 +1195,7 @@ public function testRequiresEntityDataMigration($updated_entity_type_definition,
       ->method('createHandlerInstance')
       ->willReturn($original_storage);
 
-    $this->storageSchema = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema')
+    $this->storageSchema = $this->getMockBuilder(\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::class)
       ->setConstructorArgs([$this->entityManager, $this->entityType, $this->storage, $connection])
       ->setMethods(['installedStorageSchema', 'hasSharedTableStructureChange'])
       ->getMock();
@@ -1207,8 +1215,8 @@ public function providerTestRequiresEntityStorageSchemaChanges() {
 
     $cases = [];
 
-    $updated_entity_type_definition = $this->getMock('\Drupal\Core\Entity\ContentEntityTypeInterface');
-    $original_entity_type_definition = $this->getMock('\Drupal\Core\Entity\ContentEntityTypeInterface');
+    $updated_entity_type_definition = $this->getMock(\Drupal\Core\Entity\ContentEntityTypeInterface::class);
+    $original_entity_type_definition = $this->getMock(\Drupal\Core\Entity\ContentEntityTypeInterface::class);
 
     $updated_entity_type_definition->expects($this->any())
       ->method('id')
@@ -1332,7 +1340,7 @@ protected function setUpStorageSchema(array $expected = []) {
       ->with($this->entityType->id())
       ->will($this->returnValue($this->storageDefinitions));
 
-    $this->dbSchemaHandler = $this->getMockBuilder('Drupal\Core\Database\Schema')
+    $this->dbSchemaHandler = $this->getMockBuilder(Schema::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -1356,15 +1364,15 @@ protected function setUpStorageSchema(array $expected = []) {
         }));
     }
 
-    $connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
     $connection->expects($this->any())
       ->method('schema')
       ->will($this->returnValue($this->dbSchemaHandler));
 
-    $key_value = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface');
-    $this->storageSchema = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema')
+    $key_value = $this->getMock(KeyValueStoreInterface::class);
+    $this->storageSchema = $this->getMockBuilder(\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::class)
       ->setConstructorArgs([$this->entityManager, $this->entityType, $this->storage, $connection])
       ->setMethods(['installedStorageSchema', 'loadEntitySchemaData', 'hasSharedTableNameChanges', 'isTableEmpty'])
       ->getMock();
@@ -1407,7 +1415,7 @@ public function setUpStorageDefinition($field_name, array $schema) {
     if (!empty($schema['columns'])) {
       $property_definitions = [];
       foreach ($schema['columns'] as $column => $info) {
-        $property_definitions[$column] = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface');
+        $property_definitions[$column] = $this->getMock(DataDefinitionInterface::class);
         $property_definitions[$column]->expects($this->any())
           ->method('isRequired')
           ->will($this->returnValue(!empty($info['not null'])));
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
index b3e339b..edfec7a 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
@@ -8,11 +8,21 @@
 namespace Drupal\Tests\Core\Entity\Sql;
 
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Schema;
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\Query\QueryFactoryInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
+use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -96,7 +106,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->entityType = $this->getMock('Drupal\Core\Entity\ContentEntityTypeInterface');
+    $this->entityType = $this->getMock(ContentEntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('id')
       ->will($this->returnValue($this->entityTypeId));
@@ -104,14 +114,14 @@ protected function setUp() {
     $this->container = new ContainerBuilder();
     \Drupal::setContainer($this->container);
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getDefaultLanguage')
       ->will($this->returnValue(new Language(['langcode' => 'en'])));
-    $this->connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $this->connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
   }
@@ -331,7 +341,7 @@ public function testOnEntityTypeCreate() {
       'foreign keys' => [],
     ];
 
-    $schema_handler = $this->getMockBuilder('Drupal\Core\Database\Schema')
+    $schema_handler = $this->getMockBuilder(Schema::class)
       ->disableOriginalConstructor()
       ->getMock();
     $schema_handler->expects($this->any())
@@ -342,13 +352,13 @@ public function testOnEntityTypeCreate() {
       ->method('schema')
       ->will($this->returnValue($schema_handler));
 
-    $storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager])
       ->setMethods(['getStorageSchema'])
       ->getMock();
 
-    $key_value = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface');
-    $schema_handler = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema')
+    $key_value = $this->getMock(KeyValueStoreInterface::class);
+    $schema_handler = $this->getMockBuilder(SqlContentEntityStorageSchema::class)
       ->setConstructorArgs([$this->entityManager, $this->entityType, $storage, $this->connection])
       ->setMethods(['installedStorageSchema', 'createSharedTableSchema'])
       ->getMock();
@@ -994,7 +1004,7 @@ public function testGetTableMappingRevisionableTranslatableWithFields(array $ent
    * @covers ::create
    */
   public function testCreate() {
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
 
     $language = new Language(['id' => 'en']);
     $language_manager->expects($this->any())
@@ -1005,7 +1015,7 @@ public function testCreate() {
     $this->container->set('entity.manager', $this->entityManager);
     $this->container->set('module_handler', $this->moduleHandler);
 
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->setMethods(['id'])
       ->getMockForAbstractClass();
@@ -1041,7 +1051,7 @@ public function testCreate() {
       ->method('id')
       ->will($this->returnValue('foo'));
 
-    $this->assertInstanceOf('Drupal\Core\Entity\EntityInterface', $entity);
+    $this->assertInstanceOf(EntityInterface::class, $entity);
     $this->assertSame('foo', $entity->id());
     $this->assertTrue($entity->isNew());
   }
@@ -1089,7 +1099,7 @@ protected function mockFieldDefinitions(array $field_names, $methods = []) {
    * Sets up the content entity database storage.
    */
   protected function setUpEntityStorage() {
-    $this->connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $this->connection = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -1181,7 +1191,7 @@ public function testLoadMultipleNoPersistentCache() {
     $this->cache->expects($this->never())
       ->method('set');
 
-    $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $entity_storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager])
       ->setMethods(['getFromStorage', 'invokeStorageLoadHook'])
       ->getMock();
@@ -1233,7 +1243,7 @@ public function testLoadMultiplePersistentCacheMiss() {
       ->method('set')
       ->with($key, $entity, CacheBackendInterface::CACHE_PERMANENT, [$this->entityTypeId . '_values', 'entity_field_info']);
 
-    $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
+    $entity_storage = $this->getMockBuilder(SqlContentEntityStorage::class)
       ->setConstructorArgs([$this->entityType, $this->connection, $this->entityManager, $this->cache, $this->languageManager])
       ->setMethods(['getFromStorage', 'invokeStorageLoadHook'])
       ->getMock();
@@ -1252,7 +1262,7 @@ public function testLoadMultiplePersistentCacheMiss() {
    * @covers ::hasData
    */
   public function testHasData() {
-    $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $query = $this->getMock(QueryInterface::class);
     $query->expects(($this->once()))
       ->method('accessCheck')
       ->with(FALSE)
@@ -1273,7 +1283,7 @@ public function testHasData() {
 
     $this->container->set('entity.query.sql', $factory);
 
-    $database = $this->getMockBuilder('Drupal\Core\Database\Connection')
+    $database = $this->getMockBuilder(Connection::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
index 953daac..b902511 100644
--- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
@@ -2,6 +2,17 @@
 
 namespace Drupal\Tests\Core\Entity\TypedData;
 
+use \Drupal\Component\Uuid\UuidInterface;
+use \Drupal\Core\Entity\ContentEntityBase;
+use \Drupal\Core\Entity\ContentEntityInterface;
+use \Drupal\Core\Entity\EntityManagerInterface;
+use \Drupal\Core\Entity\EntityTypeInterface;
+use \Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface;
+use \Drupal\Core\Field\FieldItemListInterface;
+use \Drupal\Core\Field\FieldTypePluginManager;
+use \Drupal\Core\Language\LanguageManagerInterface;
+use \Drupal\Core\TypedData\TraversableTypedDataInterface;
+use \Drupal\Core\Validation\ConstraintManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
 use Drupal\Core\Field\BaseFieldDefinition;
@@ -122,7 +133,7 @@ protected function setUp() {
     $this->entityTypeId = $this->randomMachineName();
     $this->bundle = $this->randomMachineName();
 
-    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType = $this->getMock(EntityTypeInterface::class);
     $this->entityType->expects($this->any())
       ->method('getKeys')
       ->will($this->returnValue([
@@ -130,24 +141,24 @@ protected function setUp() {
         'uuid' => 'uuid',
     ]));
 
-    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
     $this->entityManager->expects($this->any())
       ->method('getDefinition')
       ->with($this->entityTypeId)
       ->will($this->returnValue($this->entityType));
 
-    $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
+    $this->uuid = $this->getMock(UuidInterface::class);
 
     $this->typedDataManager = $this->getMock(TypedDataManagerInterface::class);
     $this->typedDataManager->expects($this->any())
       ->method('getDefinition')
       ->with('entity')
-      ->will($this->returnValue(['class' => '\Drupal\Core\Entity\Plugin\DataType\EntityAdapter']));
+      ->will($this->returnValue(['class' => \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::class]));
     $this->typedDataManager->expects($this->any())
       ->method('getDefaultConstraints')
       ->willReturn([]);
 
-    $validation_constraint_manager = $this->getMockBuilder('\Drupal\Core\Validation\ConstraintManager')
+    $validation_constraint_manager = $this->getMockBuilder(ConstraintManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $validation_constraint_manager->expects($this->any())
@@ -158,7 +169,7 @@ protected function setUp() {
       ->willReturn($validation_constraint_manager);
 
     $not_specified = new Language(['id' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'locked' => TRUE]);
-    $this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
     $this->languageManager->expects($this->any())
       ->method('getLanguages')
       ->will($this->returnValue([LanguageInterface::LANGCODE_NOT_SPECIFIED => $not_specified]));
@@ -168,7 +179,7 @@ protected function setUp() {
       ->with(LanguageInterface::LANGCODE_NOT_SPECIFIED)
       ->will($this->returnValue($not_specified));
 
-    $this->fieldTypePluginManager = $this->getMockBuilder('\Drupal\Core\Field\FieldTypePluginManager')
+    $this->fieldTypePluginManager = $this->getMockBuilder(FieldTypePluginManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->fieldTypePluginManager->expects($this->any())
@@ -178,7 +189,7 @@ protected function setUp() {
       ->method('getDefaultFieldSettings')
       ->will($this->returnValue([]));
 
-    $this->fieldItemList = $this->getMock('\Drupal\Core\Field\FieldItemListInterface');
+    $this->fieldItemList = $this->getMock(FieldItemListInterface::class);
     $this->fieldTypePluginManager->expects($this->any())
       ->method('createFieldItemList')
       ->willReturn($this->fieldItemList);
@@ -200,7 +211,7 @@ protected function setUp() {
       ->method('getFieldDefinitions')
       ->with($this->entityTypeId, $this->bundle)
       ->will($this->returnValue($this->fieldDefinitions));
-    $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Entity\ContentEntityBase', [$values, $this->entityTypeId, $this->bundle]);
+    $this->entity = $this->getMockForAbstractClass(ContentEntityBase::class, [$values, $this->entityTypeId, $this->bundle]);
 
     $this->entityAdapter = EntityAdapter::createFromEntity($this->entity);
   }
@@ -245,7 +256,7 @@ public function testGetParent() {
    */
   public function testSetContext() {
     $name = $this->randomMachineName();
-    $parent = $this->getMock('\Drupal\Core\TypedData\TraversableTypedDataInterface');
+    $parent = $this->getMock(TraversableTypedDataInterface::class);
     // Our mocked entity->setContext() returns NULL, so assert that.
     $this->assertNull($this->entityAdapter->setContext($name, $parent));
     $this->assertEquals($name, $this->entityAdapter->getName());
@@ -271,7 +282,7 @@ public function testSetValue() {
    * @covers ::get
    */
   public function testGet() {
-    $this->assertInstanceOf('\Drupal\Core\Field\FieldItemListInterface', $this->entityAdapter->get('id'));
+    $this->assertInstanceOf(FieldItemListInterface::class, $this->entityAdapter->get('id'));
   }
 
   /**
@@ -319,8 +330,8 @@ public function testSetWithoutData() {
  */
   public function testGetProperties() {
     $fields = $this->entityAdapter->getProperties();
-    $this->assertInstanceOf('Drupal\Core\Field\FieldItemListInterface', $fields['id']);
-    $this->assertInstanceOf('Drupal\Core\Field\FieldItemListInterface', $fields['revision_id']);
+    $this->assertInstanceOf(\Drupal\Core\Field\FieldItemListInterface::class, $fields['id']);
+    $this->assertInstanceOf(\Drupal\Core\Field\FieldItemListInterface::class, $fields['revision_id']);
   }
 
   /**
@@ -356,7 +367,7 @@ public function testIsEmpty() {
    * @covers ::onChange
    */
   public function testOnChange() {
-    $entity = $this->getMock('\Drupal\Core\Entity\ContentEntityInterface');
+    $entity = $this->getMock(ContentEntityInterface::class);
     $entity->expects($this->once())
       ->method('onChange')
       ->with('foo')
@@ -370,7 +381,7 @@ public function testOnChange() {
    */
   public function testGetDataDefinition() {
     $definition = $this->entityAdapter->getDataDefinition();
-    $this->assertInstanceOf('\Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface', $definition);
+    $this->assertInstanceOf(EntityDataDefinitionInterface::class, $definition);
     $this->assertEquals($definition->getEntityTypeId(), $this->entityTypeId);
     $this->assertEquals($definition->getBundles(), [ $this->bundle ]);
   }
@@ -379,7 +390,7 @@ public function testGetDataDefinition() {
    * @covers ::getString
    */
   public function testGetString() {
-    $entity = $this->getMock('\Drupal\Core\Entity\ContentEntityInterface');
+    $entity = $this->getMock(ContentEntityInterface::class);
     $entity->expects($this->once())
       ->method('label')
       ->willReturn('foo');
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
index 38cc28c..e9b1d09 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
@@ -2,10 +2,13 @@
 
 namespace Drupal\Tests\Core\EventSubscriber;
 
+use \Drupal\Core\Routing\RedirectDestinationInterface;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber;
+use Drupal\Core\Path\PathValidatorInterface;
 use Drupal\Core\Render\HtmlResponse;
 use Drupal\Core\Routing\AccessAwareRouterInterface;
 use Drupal\Core\Url;
@@ -85,7 +88,7 @@ protected function setUp() {
 
     $this->kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
     $this->logger = $this->getMock('Psr\Log\LoggerInterface');
-    $this->redirectDestination = $this->getMock('\Drupal\Core\Routing\RedirectDestinationInterface');
+    $this->redirectDestination = $this->getMock(RedirectDestinationInterface::class);
     $this->redirectDestination->expects($this->any())
       ->method('getAsArray')
       ->willReturn(['destination' => 'test']);
@@ -95,14 +98,14 @@ protected function setUp() {
       ->willReturn([
         '_controller' => 'mocked',
       ]);
-    $this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
     $this->accessManager->expects($this->any())
       ->method('checkNamedRoute')
       ->willReturn(AccessResult::allowed()->addCacheTags(['foo', 'bar']));
 
     $this->customPageSubscriber = new CustomPageExceptionHtmlSubscriber($this->configFactory, $this->kernel, $this->logger, $this->redirectDestination, $this->accessUnawareRouter, $this->accessManager);
 
-    $path_validator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $path_validator = $this->getMock(PathValidatorInterface::class);
     $path_validator->expects($this->any())
       ->method('getUrlIfValidWithoutAccessCheck')
       ->willReturn(Url::fromRoute('foo', ['foo' => 'bar']));
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
index 6528d73..93ad695 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
@@ -5,6 +5,7 @@
 use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\EventSubscriber\ModuleRouteSubscriber;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\Routing\RouteCollection;
 use Symfony\Component\Routing\Route;
 
@@ -22,7 +23,7 @@ class ModuleRouteSubscriberTest extends UnitTestCase {
   protected $moduleHandler;
 
   protected function setUp() {
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
     $value_map = [
       ['enabled', TRUE],
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
index ea4ec9f..b494c3e 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\EventSubscriber\PathRootsSubscriber;
 use Drupal\Core\Routing\RouteBuildEvent;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
@@ -32,7 +33,7 @@ class PathRootsSubscriberTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->state = $this->getMock('Drupal\Core\State\StateInterface');
+    $this->state = $this->getMock(StateInterface::class);
     $this->pathRootsSubscriber = new PathRootsSubscriber($this->state);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
index 08c1a6c..f6cba4d 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\EventSubscriber;
 
 use Drupal\Core\EventSubscriber\RedirectResponseSubscriber;
+use Drupal\Core\Routing\RequestContext;
 use Drupal\Core\Routing\TrustedRedirectResponse;
 use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
 use Drupal\Tests\UnitTestCase;
@@ -41,7 +42,7 @@ class RedirectResponseSubscriberTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->requestContext = $this->getMockBuilder('Drupal\Core\Routing\RequestContext')
+    $this->requestContext = $this->getMockBuilder(RequestContext::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->requestContext->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
index 796a916..08640d9 100644
--- a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Extension;
 
+use \Drupal\Core\Extension\InfoParserException;
 use Drupal\Core\Extension\InfoParser;
 use Drupal\Tests\UnitTestCase;
 use org\bovigo\vfs\vfsStream;
@@ -71,7 +72,7 @@ public function testInfoParserBroken() {
       ],
     ]);
     $filename = vfsStream::url('modules/fixtures/broken.info.txt');
-    $this->setExpectedException('\Drupal\Core\Extension\InfoParserException', 'broken.info.txt');
+    $this->setExpectedException(InfoParserException::class, 'broken.info.txt');
     $this->infoParser->parse($filename);
   }
 
@@ -96,7 +97,7 @@ public function testInfoParserMissingKeys() {
       ],
     ]);
     $filename = vfsStream::url('modules/fixtures/missing_keys.info.txt');
-    $this->setExpectedException('\Drupal\Core\Extension\InfoParserException', 'Missing required keys (type, core, name) in vfs://modules/fixtures/missing_keys.info.txt');
+    $this->setExpectedException(InfoParserException::class, 'Missing required keys (type, core, name) in vfs://modules/fixtures/missing_keys.info.txt');
     $this->infoParser->parse($filename);
   }
 
@@ -124,7 +125,7 @@ public function testInfoParserMissingKey() {
       ],
     ]);
     $filename = vfsStream::url('modules/fixtures/missing_key.info.txt');
-    $this->setExpectedException('\Drupal\Core\Extension\InfoParserException', 'Missing required keys (type) in vfs://modules/fixtures/missing_key.info.txt');
+    $this->setExpectedException(InfoParserException::class, 'Missing required keys (type) in vfs://modules/fixtures/missing_key.info.txt');
     $this->infoParser->parse($filename);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php b/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
index 55d0aaa..c6e1cab 100644
--- a/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Extension;
 
+use Drupal\Core\Extension\RequiredModuleUninstallValidator;
 use Drupal\simpletest\AssertHelperTrait;
 use Drupal\Tests\UnitTestCase;
 
@@ -23,7 +24,7 @@ class RequiredModuleUninstallValidatorTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->uninstallValidator = $this->getMockBuilder('Drupal\Core\Extension\RequiredModuleUninstallValidator')
+    $this->uninstallValidator = $this->getMockBuilder(RequiredModuleUninstallValidator::class)
       ->disableOriginalConstructor()
       ->setMethods(['getModuleInfoByModule'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
index 8c105f2..a8cf2ff 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -7,9 +7,13 @@
 
 namespace Drupal\Tests\Core\Extension;
 
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Core\Extension\Extension;
+use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\Core\Extension\InfoParser;
+use Drupal\Core\Extension\InfoParserInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Extension\ThemeHandler;
 use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
 use Drupal\Core\Lock\NullLockBackend;
@@ -79,15 +83,15 @@ protected function setUp() {
         ],
       ],
     ]);
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->state = new State(new KeyValueMemoryFactory(), new MemoryBackend('test'), new NullLockBackend());
-    $this->infoParser = $this->getMock('Drupal\Core\Extension\InfoParserInterface');
-    $this->extensionDiscovery = $this->getMockBuilder('Drupal\Core\Extension\ExtensionDiscovery')
+    $this->infoParser = $this->getMock(InfoParserInterface::class);
+    $this->extensionDiscovery = $this->getMockBuilder(ExtensionDiscovery::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->themeHandler = new StubThemeHandler($this->root, $this->configFactory, $this->moduleHandler, $this->state, $this->infoParser, $this->extensionDiscovery);
 
-    $cache_tags_invalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $cache_tags_invalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
     $this->getContainerWithCacheTagsInvalidator($cache_tags_invalidator);
   }
 
@@ -128,7 +132,7 @@ public function testRebuildThemeData() {
     $info = $theme_data['seven'];
 
     // Ensure some basic properties.
-    $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info);
+    $this->assertInstanceOf(Extension::class, $info);
     $this->assertEquals('seven', $info->getName());
     $this->assertEquals($this->root . '/core/themes/seven/seven.info.yml', $info->getPathname());
     $this->assertEquals($this->root . '/core/themes/seven/seven.theme', $info->getExtensionPathname());
@@ -195,9 +199,9 @@ public function testRebuildThemeDataWithThemeParents() {
     $info_subtheme = $theme_data['test_subtheme'];
 
     // Ensure some basic properties.
-    $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_basetheme);
+    $this->assertInstanceOf(Extension::class, $info_basetheme);
     $this->assertEquals('test_basetheme', $info_basetheme->getName());
-    $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info_subtheme);
+    $this->assertInstanceOf(Extension::class, $info_subtheme);
     $this->assertEquals('test_subtheme', $info_subtheme->getName());
 
     // Test the parent/child-theme properties.
diff --git a/core/tests/Drupal/Tests/Core/Field/BaseFieldDefinitionTestBase.php b/core/tests/Drupal/Tests/Core/Field/BaseFieldDefinitionTestBase.php
index acb7346..ae08939 100644
--- a/core/tests/Drupal/Tests/Core/Field/BaseFieldDefinitionTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Field/BaseFieldDefinitionTestBase.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\Tests\Core\Field;
 
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Field\FieldTypePluginManager;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
@@ -32,7 +34,7 @@ protected function setUp() {
     $namespaces = new \ArrayObject();
     $namespaces["Drupal\\$module_name"] = $module_dir . '/src';
 
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $module_handler->expects($this->once())
       ->method('moduleExists')
       ->with($module_name)
@@ -40,7 +42,7 @@ protected function setUp() {
     $typed_data_manager = $this->getMock(TypedDataManagerInterface::class);
     $plugin_manager = new FieldTypePluginManager(
       $namespaces,
-      $this->getMock('Drupal\Core\Cache\CacheBackendInterface'),
+      $this->getMock(CacheBackendInterface::class),
       $module_handler,
       $typed_data_manager
     );
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
index 8927597..e3987dc 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
@@ -4,8 +4,11 @@
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Field\FieldItemList;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Tests\UnitTestCase;
 
@@ -23,16 +26,16 @@ class FieldItemListTest extends UnitTestCase {
   public function testEquals($expected, FieldItemInterface $first_field_item = NULL, FieldItemInterface $second_field_item = NULL) {
 
     // Mock the field type manager and place it in the container.
-    $field_type_manager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $field_type_manager = $this->getMock(FieldTypePluginManagerInterface::class);
     $container = new ContainerBuilder();
     $container->set('plugin.manager.field.field_type', $field_type_manager);
     \Drupal::setContainer($container);
 
-    $field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $field_storage_definition->expects($this->any())
       ->method('getColumns')
       ->willReturn([0 => '0', 1 => '1']);
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->any())
       ->method('getFieldStorageDefinition')
       ->willReturn($field_storage_definition);
@@ -64,7 +67,7 @@ public function providerTestEquals() {
     $datasets[] = [TRUE];
 
     /** @var \Drupal\Core\Field\FieldItemBase  $field_item_a */
-    $field_item_a = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $field_item_a = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $field_item_a->setValue([1]);
     // Tests field item lists where one has a value and one does not.
     $datasets[] = [FALSE, $field_item_a];
@@ -73,22 +76,22 @@ public function providerTestEquals() {
     $datasets[] = [TRUE, $field_item_a, $field_item_a];
 
     /** @var \Drupal\Core\Field\FieldItemBase  $fv */
-    $field_item_b = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $field_item_b = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $field_item_b->setValue([2]);
     // Tests field item lists where both have the different values.
     $datasets[] = [FALSE, $field_item_a, $field_item_b];
 
     /** @var \Drupal\Core\Field\FieldItemBase  $fv */
-    $field_item_c = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $field_item_c = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $field_item_c->setValue(['0' => 1, '1' => 2]);
-    $field_item_d = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $field_item_d = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $field_item_d->setValue(['1' => 2, '0' => 1]);
 
     // Tests field item lists where both have the differently ordered values.
     $datasets[] = [TRUE, $field_item_c, $field_item_d];
 
     /** @var \Drupal\Core\Field\FieldItemBase  $field_item_e */
-    $field_item_e = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $field_item_e = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $field_item_e->setValue(['2']);
 
     // Tests field item lists where both have same values but different data
@@ -103,22 +106,22 @@ public function providerTestEquals() {
    */
   public function testEqualsEmptyItems() {
     /** @var \Drupal\Core\Field\FieldItemBase  $fv */
-    $first_field_item = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $first_field_item = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $first_field_item->setValue(['0' => 1, '1' => 2]);
-    $second_field_item = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $second_field_item = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     $second_field_item->setValue(['1' => 2, '0' => 1]);
-    $empty_field_item = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
+    $empty_field_item = $this->getMockForAbstractClass(FieldItemBase::class, [], '', FALSE);
     // Mock the field type manager and place it in the container.
-    $field_type_manager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
+    $field_type_manager = $this->getMock(FieldTypePluginManagerInterface::class);
     $container = new ContainerBuilder();
     $container->set('plugin.manager.field.field_type', $field_type_manager);
     \Drupal::setContainer($container);
 
-    $field_storage_definition = $this->getMock('Drupal\Core\Field\FieldStorageDefinitionInterface');
+    $field_storage_definition = $this->getMock(FieldStorageDefinitionInterface::class);
     $field_storage_definition->expects($this->any())
       ->method('getColumns')
       ->willReturn([0 => '0', 1 => '1']);
-    $field_definition = $this->getMock('Drupal\Core\Field\FieldDefinitionInterface');
+    $field_definition = $this->getMock(FieldDefinitionInterface::class);
     $field_definition->expects($this->any())
       ->method('getFieldStorageDefinition')
       ->willReturn($field_storage_definition);
diff --git a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
index 645daf4..b560c2c 100644
--- a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
+++ b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\File\FileSystem;
 use Drupal\Core\Site\Settings;
+use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use org\bovigo\vfs\vfsStream;
 
@@ -33,7 +34,7 @@ protected function setUp() {
     parent::setUp();
 
     $settings = new Settings([]);
-    $stream_wrapper_manager = $this->getMock('Drupal\Core\StreamWrapper\StreamWrapperManagerInterface');
+    $stream_wrapper_manager = $this->getMock(StreamWrapperManagerInterface::class);
     $this->logger = $this->getMock('Psr\Log\LoggerInterface');
     $this->fileSystem = new FileSystem($stream_wrapper_manager, $settings, $this->logger);
   }
@@ -84,7 +85,7 @@ public function testUnlink() {
     vfsStream::create(['test.txt' => 'asdf']);
     $uri = 'vfs://dir/test.txt';
 
-    $this->fileSystem = $this->getMockBuilder('Drupal\Core\File\FileSystem')
+    $this->fileSystem = $this->getMockBuilder(FileSystem::class)
       ->disableOriginalConstructor()
       ->setMethods(['validScheme'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php b/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
index f2e9717..80a7018 100644
--- a/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
+++ b/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
@@ -27,7 +27,7 @@ public function testSymfonyGuesserRegistration() {
     // not support the default guessers.
     $guessers = $this->readAttribute($symfony_guesser, 'guessers');
     if (count($guessers)) {
-      $this->assertNotInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
+      $this->assertNotInstanceOf(MimeTypeGuesser::class, $guessers[0]);
     }
     $container = new ContainerBuilder();
     $container->set('file.mime_type.guesser', new MimeTypeGuesser(new StreamWrapperManager()));
@@ -35,7 +35,7 @@ public function testSymfonyGuesserRegistration() {
     $symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
     $guessers = $this->readAttribute($symfony_guesser, 'guessers');
     $this->assertSame($container->get('file.mime_type.guesser'), $guessers[0]);
-    $this->assertInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
+    $this->assertInstanceOf(MimeTypeGuesser::class, $guessers[0]);
     $count = count($guessers);
 
     $container = new ContainerBuilder();
@@ -44,7 +44,7 @@ public function testSymfonyGuesserRegistration() {
     $symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
     $guessers = $this->readAttribute($symfony_guesser, 'guessers');
     $this->assertSame($container->get('file.mime_type.guesser'), $guessers[0]);
-    $this->assertInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
+    $this->assertInstanceOf(MimeTypeGuesser::class, $guessers[0]);
     $new_count = count($guessers);
     $this->assertEquals($count, $new_count, 'The count of mime type guessers remains the same after container re-init.');
   }
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
index 14e03cb..f86b605 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\Tests\Core\Form;
 
+use \Drupal\Core\Config\Config;
+use \Drupal\Core\Config\ImmutableConfig;
+use Drupal\Core\Form\ConfigFormBaseTrait;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -15,7 +18,7 @@ class ConfigFormBaseTraitTest extends UnitTestCase {
    */
   public function testConfig() {
 
-    $trait = $this->getMockForTrait('Drupal\Core\Form\ConfigFormBaseTrait');
+    $trait = $this->getMockForTrait(ConfigFormBaseTrait::class);
     // Set up some configuration in a mocked config factory.
     $trait->configFactory = $this->getConfigFactoryStub([
       'editable.config' => [],
@@ -31,19 +34,19 @@ public function testConfig() {
 
     // Ensure that configuration that is expected to be mutable is.
     $result = $config_method->invoke($trait, 'editable.config');
-    $this->assertInstanceOf('\Drupal\Core\Config\Config', $result);
-    $this->assertNotInstanceOf('\Drupal\Core\Config\ImmutableConfig', $result);
+    $this->assertInstanceOf(Config::class, $result);
+    $this->assertNotInstanceOf(ImmutableConfig::class, $result);
 
     // Ensure that configuration that is expected to be immutable is.
     $result = $config_method->invoke($trait, 'immutable.config');
-    $this->assertInstanceOf('\Drupal\Core\Config\ImmutableConfig', $result);
+    $this->assertInstanceOf(ImmutableConfig::class, $result);
   }
 
   /**
    * @covers ::config
    */
   public function testConfigFactoryException() {
-    $trait = $this->getMockForTrait('Drupal\Core\Form\ConfigFormBaseTrait');
+    $trait = $this->getMockForTrait(ConfigFormBaseTrait::class);
     $config_method = new \ReflectionMethod($trait, 'config');
     $config_method->setAccessible(TRUE);
 
@@ -56,7 +59,7 @@ public function testConfigFactoryException() {
    * @covers ::config
    */
   public function testConfigFactoryExceptionInvalidProperty() {
-    $trait = $this->getMockForTrait('Drupal\Core\Form\ConfigFormBaseTrait');
+    $trait = $this->getMockForTrait(ConfigFormBaseTrait::class);
     $trait->configFactory = TRUE;
     $config_method = new \ReflectionMethod($trait, 'config');
     $config_method->setAccessible(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php b/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
index 15f52a6..72ef0a2 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\Form;
 
 use Drupal\Core\Form\ConfirmFormHelper;
+use Drupal\Core\Form\ConfirmFormInterface;
+use Drupal\Core\Path\PathValidatorInterface;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -21,7 +23,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
    */
   public function testCancelLinkTitle() {
     $cancel_text = 'Cancel text';
-    $form = $this->getMock('Drupal\Core\Form\ConfirmFormInterface');
+    $form = $this->getMock(ConfirmFormInterface::class);
     $form->expects($this->any())
       ->method('getCancelText')
       ->will($this->returnValue($cancel_text));
@@ -39,7 +41,7 @@ public function testCancelLinkTitle() {
   public function testCancelLinkRoute() {
     $route_name = 'foo_bar';
     $cancel_route = new Url($route_name);
-    $form = $this->getMock('Drupal\Core\Form\ConfirmFormInterface');
+    $form = $this->getMock(ConfirmFormInterface::class);
     $form->expects($this->any())
       ->method('getCancelUrl')
       ->will($this->returnValue($cancel_route));
@@ -55,7 +57,7 @@ public function testCancelLinkRoute() {
    */
   public function testCancelLinkRouteWithParams() {
     $expected = Url::fromRoute('foo_bar.baz', ['baz' => 'banana'], ['absolute' => TRUE]);
-    $form = $this->getMock('Drupal\Core\Form\ConfirmFormInterface');
+    $form = $this->getMock(ConfirmFormInterface::class);
     $form->expects($this->any())
       ->method('getCancelUrl')
       ->will($this->returnValue($expected));
@@ -78,7 +80,7 @@ public function testCancelLinkRouteWithUrl() {
         'absolute' => TRUE,
       ]
     );
-    $form = $this->getMock('Drupal\Core\Form\ConfirmFormInterface');
+    $form = $this->getMock(ConfirmFormInterface::class);
     $form->expects($this->any())
       ->method('getCancelUrl')
       ->will($this->returnValue($cancel_route));
@@ -96,9 +98,9 @@ public function testCancelLinkRouteWithUrl() {
    */
   public function testCancelLinkDestination($destination) {
     $query = ['destination' => $destination];
-    $form = $this->getMock('Drupal\Core\Form\ConfirmFormInterface');
+    $form = $this->getMock(ConfirmFormInterface::class);
 
-    $path_validator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $path_validator = $this->getMock(PathValidatorInterface::class);
     $container_builder = new ContainerBuilder();
     $container_builder->set('path.validator', $path_validator);
     \Drupal::setContainer($container_builder);
diff --git a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
index 050d745..9489c23 100644
--- a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
@@ -2,12 +2,15 @@
 
 namespace Drupal\Tests\Core\Form\EventSubscriber;
 
+use \Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber;
 use Drupal\Core\Form\Exception\BrokenPostRequestException;
 use Drupal\Core\Form\FormAjaxException;
+use Drupal\Core\Form\FormAjaxResponseBuilderInterface;
 use Drupal\Core\Form\FormBuilderInterface;
 use Drupal\Core\Form\FormState;
+use Drupal\Core\Render\RendererInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
@@ -50,7 +53,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->httpKernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
-    $this->formAjaxResponseBuilder = $this->getMock('Drupal\Core\Form\FormAjaxResponseBuilderInterface');
+    $this->formAjaxResponseBuilder = $this->getMock(FormAjaxResponseBuilderInterface::class);
     $this->stringTranslation = $this->getStringTranslationStub();
     $this->subscriber = new FormAjaxSubscriber($this->formAjaxResponseBuilder, $this->stringTranslation);
   }
@@ -145,7 +148,7 @@ public function testOnExceptionResponseBuilderException() {
   public function testOnExceptionBrokenPostRequest() {
     $this->formAjaxResponseBuilder->expects($this->never())
       ->method('buildResponse');
-    $this->subscriber = $this->getMockBuilder('\Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber')
+    $this->subscriber = $this->getMockBuilder(\Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber::class)
       ->setConstructorArgs([$this->formAjaxResponseBuilder, $this->getStringTranslationStub()])
       ->setMethods(['drupalSetMessage', 'formatSize'])
       ->getMock();
@@ -159,7 +162,7 @@ public function testOnExceptionBrokenPostRequest() {
     $rendered_output = 'the rendered output';
     // CommandWithAttachedAssetsTrait::getRenderedContent() will call the
     // renderer service via the container.
-    $renderer = $this->getMock('Drupal\Core\Render\RendererInterface');
+    $renderer = $this->getMock(RendererInterface::class);
     $renderer->expects($this->once())
       ->method('renderRoot')
       ->with()
@@ -177,7 +180,7 @@ public function testOnExceptionBrokenPostRequest() {
     $event = new GetResponseForExceptionEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST, $exception);
     $this->subscriber->onException($event);
     $actual_response = $event->getResponse();
-    $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $actual_response);
+    $this->assertInstanceOf(AjaxResponse::class, $actual_response);
     $this->assertSame(200, $actual_response->headers->get('X-Status-Code'));
     $expected_commands[] = [
       'command' => 'insert',
diff --git a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
index 177504c..75a5a9d 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
@@ -7,6 +7,8 @@
 use Drupal\Core\Form\FormAjaxResponseBuilder;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\MainContent\MainContentRendererInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -37,8 +39,8 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->renderer = $this->getMock('Drupal\Core\Render\MainContent\MainContentRendererInterface');
-    $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $this->renderer = $this->getMock(MainContentRendererInterface::class);
+    $this->routeMatch = $this->getMock(RouteMatchInterface::class);
     $this->formAjaxResponseBuilder = new FormAjaxResponseBuilder($this->renderer, $this->routeMatch);
   }
 
@@ -105,7 +107,7 @@ public function testBuildResponseRenderArray() {
       ->willReturn(new AjaxResponse([]));
 
     $result = $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands);
-    $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $result);
+    $this->assertInstanceOf(\Drupal\Core\Ajax\AjaxResponse::class, $result);
     $this->assertSame($commands, $result->getCommands());
   }
 
@@ -130,7 +132,7 @@ public function testBuildResponseResponse() {
       ->method('renderResponse');
 
     $result = $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands);
-    $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $result);
+    $this->assertInstanceOf(\Drupal\Core\Ajax\AjaxResponse::class, $result);
     $this->assertSame($commands, $result->getCommands());
   }
 
@@ -163,7 +165,7 @@ public function testBuildResponseWithCommands() {
       ->method('renderResponse');
 
     $result = $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands);
-    $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $result);
+    $this->assertInstanceOf(\Drupal\Core\Ajax\AjaxResponse::class, $result);
     $this->assertSame($commands_expected, $result->getCommands());
   }
 
@@ -199,7 +201,7 @@ public function testBuildResponseWithUpdateCommand() {
       ->method('renderResponse');
 
     $result = $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands);
-    $this->assertInstanceOf('\Drupal\Core\Ajax\AjaxResponse', $result);
+    $this->assertInstanceOf(\Drupal\Core\Ajax\AjaxResponse::class, $result);
     $this->assertSame($commands_expected, $result->getCommands());
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
index aa3739c..45536d1 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Drupal\Core\Form\BaseFormIdInterface;
 use Drupal\Core\Form\EnforcedResponseException;
 use Drupal\Core\Form\Exception\BrokenPostRequestException;
 use Drupal\Core\Form\FormBuilder;
@@ -19,6 +20,7 @@
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\Element\Token;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Session\AccountProxyInterface;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -112,7 +114,7 @@ public function testGetFormIdWithBaseForm() {
     $expected_form_id = 'my_module_form_id';
     $base_form_id = 'my_module';
 
-    $form_arg = $this->getMock('Drupal\Core\Form\BaseFormIdInterface');
+    $form_arg = $this->getMock(BaseFormIdInterface::class);
     $form_arg->expects($this->once())
       ->method('getFormId')
       ->will($this->returnValue($expected_form_id));
@@ -343,7 +345,7 @@ public function testRebuildForm() {
     $expected_form = $form_id();
 
     // The form will be built four times.
-    $form_arg = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form_arg = $this->getMock(FormInterface::class);
     $form_arg->expects($this->exactly(2))
       ->method('getFormId')
       ->will($this->returnValue($form_id));
@@ -383,7 +385,7 @@ public function testRebuildFormOnGetRequest() {
     $expected_form = $form_id();
 
     // The form will be built four times.
-    $form_arg = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form_arg = $this->getMock(FormInterface::class);
     $form_arg->expects($this->exactly(2))
       ->method('getFormId')
       ->will($this->returnValue($form_id));
@@ -423,7 +425,7 @@ public function testGetCache() {
 
     // FormBuilder::buildForm() will be called twice, but the form object will
     // only be called once due to caching.
-    $form_arg = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form_arg = $this->getMock(FormInterface::class);
     $form_arg->expects($this->exactly(2))
       ->method('getFormId')
       ->will($this->returnValue($form_id));
@@ -465,7 +467,7 @@ public function testUniqueHtmlId() {
     $expected_form['test']['#required'] = TRUE;
 
     // Mock a form object that will be built two times.
-    $form_arg = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form_arg = $this->getMock(FormInterface::class);
     $form_arg->expects($this->exactly(2))
       ->method('getFormId')
       ->will($this->returnValue($form_id));
@@ -534,7 +536,7 @@ public function testExceededFileSize() {
     $request = new Request([FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]);
     $request_stack = new RequestStack();
     $request_stack->push($request);
-    $this->formBuilder = $this->getMockBuilder('\Drupal\Core\Form\FormBuilder')
+    $this->formBuilder = $this->getMockBuilder(\Drupal\Core\Form\FormBuilder::class)
       ->setConstructorArgs([$this->formValidator, $this->formSubmitter, $this->formCache, $this->moduleHandler, $this->eventDispatcher, $request_stack, $this->classResolver, $this->elementInfo, $this->themeManager, $this->csrfToken])
       ->setMethods(['getFileUploadMaxSize'])
       ->getMock();
@@ -758,11 +760,11 @@ public function providerTestValueCallableIsSafe() {
       TRUE,
     ];
     $data['array_no_slash'] = [
-      ['Drupal\Core\Render\Element\Token', 'valueCallback'],
+      [Token::class, 'valueCallback'],
       TRUE,
     ];
     $data['array_with_slash'] = [
-      ['\Drupal\Core\Render\Element\Token', 'valueCallback'],
+      [\Drupal\Core\Render\Element\Token::class, 'valueCallback'],
       TRUE,
     ];
     $data['closure'] = [
@@ -836,7 +838,7 @@ public function testFormTokenCacheability($token, $is_authenticated, $expected_f
       $form['#token'] = $token;
     }
 
-    $form_arg = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form_arg = $this->getMock(FormInterface::class);
     $form_arg->expects($this->once())
       ->method('getFormId')
       ->will($this->returnValue($form_id));
diff --git a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
index 8b2734d..a1e117f 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
@@ -2,8 +2,15 @@
 
 namespace Drupal\Tests\Core\Form;
 
+use \Drupal\Core\PageCache\RequestPolicyInterface;
+use \Symfony\Component\HttpFoundation\RequestStack;
+use Drupal\Core\Access\CsrfTokenGenerator;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormCache;
 use Drupal\Core\Form\FormState;
+use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -98,11 +105,11 @@ class FormCacheTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
-    $this->formCacheStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
-    $this->formStateCacheStore = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface');
-    $this->keyValueExpirableFactory = $this->getMock('Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface');
+    $this->formCacheStore = $this->getMock(KeyValueStoreExpirableInterface::class);
+    $this->formStateCacheStore = $this->getMock(KeyValueStoreExpirableInterface::class);
+    $this->keyValueExpirableFactory = $this->getMock(KeyValueExpirableFactoryInterface::class);
     $this->keyValueExpirableFactory->expects($this->any())
       ->method('get')
       ->will($this->returnValueMap([
@@ -110,14 +117,14 @@ protected function setUp() {
         ['form_state', $this->formStateCacheStore],
       ]));
 
-    $this->csrfToken = $this->getMockBuilder('Drupal\Core\Access\CsrfTokenGenerator')
+    $this->csrfToken = $this->getMockBuilder(CsrfTokenGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->account = $this->getMock(AccountInterface::class);
 
     $this->logger = $this->getMock('Psr\Log\LoggerInterface');
-    $this->requestStack = $this->getMock('\Symfony\Component\HttpFoundation\RequestStack');
-    $this->requestPolicy = $this->getMock('\Drupal\Core\PageCache\RequestPolicyInterface');
+    $this->requestStack = $this->getMock(RequestStack::class);
+    $this->requestPolicy = $this->getMock(RequestPolicyInterface::class);
 
     $this->formCache = new FormCache($this->root, $this->keyValueExpirableFactory, $this->moduleHandler, $this->account, $this->csrfToken, $this->logger, $this->requestStack, $this->requestPolicy);
   }
diff --git a/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php b/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
index 8e2fc0d..0caa5e4 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Form;
 
+use Drupal\Core\Form\FormErrorHandler;
 use Drupal\Core\Form\FormState;
 use Drupal\Tests\UnitTestCase;
 
@@ -16,7 +17,7 @@ class FormErrorHandlerTest extends UnitTestCase {
    * @covers ::displayErrorMessages
    */
   public function testDisplayErrorMessages() {
-    $form_error_handler = $this->getMockBuilder('Drupal\Core\Form\FormErrorHandler')
+    $form_error_handler = $this->getMockBuilder(FormErrorHandler::class)
       ->setMethods(['drupalSetMessage'])
       ->getMock();
 
@@ -97,7 +98,7 @@ public function testDisplayErrorMessages() {
    * @covers ::setElementErrorsFromFormState
    */
   public function testSetElementErrorsFromFormState() {
-    $form_error_handler = $this->getMockBuilder('Drupal\Core\Form\FormErrorHandler')
+    $form_error_handler = $this->getMockBuilder(FormErrorHandler::class)
       ->setMethods(['drupalSetMessage'])
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
index 4017904..7e21137 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
@@ -179,7 +179,7 @@ public function testLoadInclude() {
     $type = 'some_type';
     $module = 'some_module';
     $name = 'some_name';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['moduleLoadInclude'])
       ->getMock();
     $form_state->expects($this->once())
@@ -195,7 +195,7 @@ public function testLoadInclude() {
   public function testLoadIncludeNoName() {
     $type = 'some_type';
     $module = 'some_module';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['moduleLoadInclude'])
       ->getMock();
     $form_state->expects($this->once())
@@ -211,7 +211,7 @@ public function testLoadIncludeNoName() {
   public function testLoadIncludeNotFound() {
     $type = 'some_type';
     $module = 'some_module';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['moduleLoadInclude'])
       ->getMock();
     $form_state->expects($this->once())
@@ -228,7 +228,7 @@ public function testLoadIncludeAlreadyLoaded() {
     $type = 'some_type';
     $module = 'some_module';
     $name = 'some_name';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['moduleLoadInclude'])
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
index 15df6f6..b538532 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
@@ -3,7 +3,10 @@
 namespace Drupal\Tests\Core\Form;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\FormSubmitter;
 use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Core\Url;
 use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
@@ -108,7 +111,7 @@ public function providerTestHandleFormSubmissionWithResponses() {
   public function testRedirectWithNull() {
     $form_submitter = $this->getFormSubmitter();
 
-    $form_state = $this->getMock('Drupal\Core\Form\FormStateInterface');
+    $form_state = $this->getMock(FormStateInterface::class);
     $form_state->expects($this->once())
       ->method('getRedirect')
       ->willReturn(NULL);
@@ -144,7 +147,7 @@ public function testRedirectWithUrl(Url $redirect_value, $result, $status = 303)
         ])
       );
 
-    $form_state = $this->getMock('Drupal\Core\Form\FormStateInterface');
+    $form_state = $this->getMock(FormStateInterface::class);
     $form_state->expects($this->once())
       ->method('getRedirect')
       ->willReturn($redirect_value);
@@ -174,7 +177,7 @@ public function providerTestRedirectWithUrl() {
   public function testRedirectWithResponseObject() {
     $form_submitter = $this->getFormSubmitter();
     $redirect = new RedirectResponse('/example');
-    $form_state = $this->getMock('Drupal\Core\Form\FormStateInterface');
+    $form_state = $this->getMock(FormStateInterface::class);
     $form_state->expects($this->once())
       ->method('getRedirect')
       ->willReturn($redirect);
@@ -199,7 +202,7 @@ public function testRedirectWithoutResult() {
     $container->set('url_generator', $this->urlGenerator);
     $container->set('unrouted_url_assembler', $this->unroutedUrlAssembler);
     \Drupal::setContainer($container);
-    $form_state = $this->getMock('Drupal\Core\Form\FormStateInterface');
+    $form_state = $this->getMock(FormStateInterface::class);
     $form_state->expects($this->once())
       ->method('getRedirect')
       ->willReturn(FALSE);
@@ -212,16 +215,16 @@ public function testRedirectWithoutResult() {
    */
   public function testExecuteSubmitHandlers() {
     $form_submitter = $this->getFormSubmitter();
-    $mock = $this->getMockForAbstractClass('Drupal\Core\Form\FormBase', [], '', TRUE, TRUE, TRUE, ['submit_handler', 'hash_submit', 'simple_string_submit']);
+    $mock = $this->getMockForAbstractClass(FormBase::class, [], '', TRUE, TRUE, TRUE, ['submit_handler', 'hash_submit', 'simple_string_submit']);
     $mock->expects($this->once())
       ->method('submit_handler')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class));
     $mock->expects($this->once())
       ->method('hash_submit')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class));
     $mock->expects($this->once())
       ->method('simple_string_submit')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class));
 
     $form = [];
     $form_state = new FormState();
@@ -247,7 +250,7 @@ public function testExecuteSubmitHandlers() {
   protected function getFormSubmitter() {
     $request_stack = new RequestStack();
     $request_stack->push(Request::create('/test-path'));
-    return $this->getMockBuilder('Drupal\Core\Form\FormSubmitter')
+    return $this->getMockBuilder(FormSubmitter::class)
       ->setConstructorArgs([$request_stack, $this->urlGenerator])
       ->setMethods(['batchGet', 'drupalInstallationAttempted'])
       ->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
index ef08ab7..80ab009 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
@@ -2,11 +2,24 @@
 
 namespace Drupal\Tests\Core\Form;
 
+use \Drupal\Core\DrupalKernel;
+use \Drupal\Core\Render\ElementInfoManagerInterface;
 use Drupal\Component\Utility\Html;
+use Drupal\Core\Access\CsrfTokenGenerator;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBuilder;
+use Drupal\Core\Form\FormCacheInterface;
+use Drupal\Core\Form\FormErrorHandlerInterface;
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\FormSubmitter;
+use Drupal\Core\Form\FormValidator;
+use Drupal\Core\Logger\LoggerChannelInterface;
+use Drupal\Core\Routing\UrlGeneratorInterface;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -150,40 +163,40 @@ protected function setUp() {
     // Add functions to the global namespace for testing.
     require_once __DIR__ . '/fixtures/form_base_test.inc';
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
-    $this->formCache = $this->getMock('Drupal\Core\Form\FormCacheInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->urlGenerator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $this->formCache = $this->getMock(FormCacheInterface::class);
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
 
     $this->classResolver = $this->getClassResolverStub();
 
-    $this->elementInfo = $this->getMockBuilder('\Drupal\Core\Render\ElementInfoManagerInterface')
+    $this->elementInfo = $this->getMockBuilder(ElementInfoManagerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->elementInfo->expects($this->any())
       ->method('getInfo')
       ->will($this->returnCallback([$this, 'getInfo']));
 
-    $this->csrfToken = $this->getMockBuilder('Drupal\Core\Access\CsrfTokenGenerator')
+    $this->csrfToken = $this->getMockBuilder(CsrfTokenGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->kernel = $this->getMockBuilder('\Drupal\Core\DrupalKernel')
+    $this->kernel = $this->getMockBuilder(DrupalKernel::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
+    $this->account = $this->getMock(AccountInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
     $this->request = new Request();
     $this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
     $this->requestStack = new RequestStack();
     $this->requestStack->push($this->request);
-    $this->logger = $this->getMock('Drupal\Core\Logger\LoggerChannelInterface');
-    $form_error_handler = $this->getMock('Drupal\Core\Form\FormErrorHandlerInterface');
-    $this->formValidator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $this->logger = $this->getMock(LoggerChannelInterface::class);
+    $form_error_handler = $this->getMock(FormErrorHandlerInterface::class);
+    $this->formValidator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([$this->requestStack, $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $form_error_handler])
       ->setMethods(NULL)
       ->getMock();
-    $this->formSubmitter = $this->getMockBuilder('Drupal\Core\Form\FormSubmitter')
+    $this->formSubmitter = $this->getMockBuilder(FormSubmitter::class)
       ->setConstructorArgs([$this->requestStack, $this->urlGenerator])
       ->setMethods(['batchGet', 'drupalInstallationAttempted'])
       ->getMock();
@@ -216,7 +229,7 @@ protected function tearDown() {
    *   The mocked form object.
    */
   protected function getMockForm($form_id, $expected_form = NULL, $count = 1) {
-    $form = $this->getMock('Drupal\Core\Form\FormInterface');
+    $form = $this->getMock(FormInterface::class);
     $form->expects($this->once())
       ->method('getFormId')
       ->will($this->returnValue($form_id));
diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
index 18f0be2..b2e6766 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
@@ -2,7 +2,11 @@
 
 namespace Drupal\Tests\Core\Form;
 
+use Drupal\Core\Access\CsrfTokenGenerator;
+use Drupal\Core\Form\FormErrorHandlerInterface;
 use Drupal\Core\Form\FormState;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\FormValidator;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -40,10 +44,10 @@ class FormValidatorTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
     $this->logger = $this->getMock('Psr\Log\LoggerInterface');
-    $this->csrfToken = $this->getMockBuilder('Drupal\Core\Access\CsrfTokenGenerator')
+    $this->csrfToken = $this->getMockBuilder(CsrfTokenGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->formErrorHandler = $this->getMock('Drupal\Core\Form\FormErrorHandlerInterface');
+    $this->formErrorHandler = $this->getMock(FormErrorHandlerInterface::class);
   }
 
   /**
@@ -53,7 +57,7 @@ protected function setUp() {
    * @covers ::finalizeValidation
    */
   public function testValidationComplete() {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(NULL)
       ->getMock();
@@ -71,7 +75,7 @@ public function testValidationComplete() {
    * @covers ::validateForm
    */
   public function testPreventDuplicateValidation() {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['doValidateForm'])
       ->getMock();
@@ -91,7 +95,7 @@ public function testPreventDuplicateValidation() {
    * @covers ::validateForm
    */
   public function testMustValidate() {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['doValidateForm'])
       ->getMock();
@@ -118,7 +122,7 @@ public function testValidateInvalidFormToken() {
       ->method('validate')
       ->will($this->returnValue(FALSE));
 
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([$request_stack, $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['doValidateForm'])
       ->getMock();
@@ -126,7 +130,7 @@ public function testValidateInvalidFormToken() {
       ->method('doValidateForm');
 
     $form['#token'] = 'test_form_id';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['setErrorByName'])
       ->getMock();
     $form_state->expects($this->once())
@@ -146,7 +150,7 @@ public function testValidateValidFormToken() {
       ->method('validate')
       ->will($this->returnValue(TRUE));
 
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([$request_stack, $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['doValidateForm'])
       ->getMock();
@@ -154,7 +158,7 @@ public function testValidateValidFormToken() {
       ->method('doValidateForm');
 
     $form['#token'] = 'test_form_id';
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['setErrorByName'])
       ->getMock();
     $form_state->expects($this->never())
@@ -170,7 +174,7 @@ public function testValidateValidFormToken() {
    * @dataProvider providerTestHandleErrorsWithLimitedValidation
    */
   public function testHandleErrorsWithLimitedValidation($sections, $triggering_element, $values, $expected) {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(NULL)
       ->getMock();
@@ -266,17 +270,17 @@ public function providerTestHandleErrorsWithLimitedValidation() {
    * @covers ::executeValidateHandlers
    */
   public function testExecuteValidateHandlers() {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(NULL)
       ->getMock();
     $mock = $this->getMock('stdClass', ['validate_handler', 'hash_validate']);
     $mock->expects($this->once())
       ->method('validate_handler')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class));
     $mock->expects($this->once())
       ->method('hash_validate')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'));
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class));
 
     $form = [];
     $form_state = new FormState();
@@ -297,7 +301,7 @@ public function testExecuteValidateHandlers() {
    * @dataProvider providerTestRequiredErrorMessage
    */
   public function testRequiredErrorMessage($element, $expected_message) {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['executeValidateHandlers'])
       ->getMock();
@@ -312,7 +316,7 @@ public function testRequiredErrorMessage($element, $expected_message) {
       '#required' => TRUE,
       '#parents' => ['test'],
     ];
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['setError'])
       ->getMock();
     $form_state->expects($this->once())
@@ -345,7 +349,7 @@ public function providerTestRequiredErrorMessage() {
    * @covers ::doValidateForm
    */
   public function testElementValidate() {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['executeValidateHandlers'])
       ->getMock();
@@ -354,7 +358,7 @@ public function testElementValidate() {
     $mock = $this->getMock('stdClass', ['element_validate']);
     $mock->expects($this->once())
       ->method('element_validate')
-      ->with($this->isType('array'), $this->isInstanceOf('Drupal\Core\Form\FormStateInterface'), NULL);
+      ->with($this->isType('array'), $this->isInstanceOf(FormStateInterface::class), NULL);
 
     $form = [];
     $form['test'] = [
@@ -373,7 +377,7 @@ public function testElementValidate() {
    * @dataProvider providerTestPerformRequiredValidation
    */
   public function testPerformRequiredValidation($element, $expected_message, $call_watchdog) {
-    $form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
+    $form_validator = $this->getMockBuilder(FormValidator::class)
       ->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
       ->setMethods(['setError'])
       ->getMock();
@@ -391,7 +395,7 @@ public function testPerformRequiredValidation($element, $expected_message, $call
       '#required' => FALSE,
       '#parents' => ['test'],
     ];
-    $form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
+    $form_state = $this->getMockBuilder(FormState::class)
       ->setMethods(['setError'])
       ->getMock();
     $form_state->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Image/ImageTest.php b/core/tests/Drupal/Tests/Core/Image/ImageTest.php
index 6b35f86..867b90b 100644
--- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php
+++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php
@@ -209,7 +209,7 @@ public function testSave() {
       ->method('save')
       ->will($this->returnValue(TRUE));
 
-    $image = $this->getMock('Drupal\Core\Image\Image', ['chmod'], [$toolkit, $this->image->getSource()]);
+    $image = $this->getMock(Image::class, ['chmod'], [$toolkit, $this->image->getSource()]);
     $image->expects($this->any())
       ->method('chmod')
       ->will($this->returnValue(TRUE));
@@ -241,7 +241,7 @@ public function testChmodFails() {
       ->method('save')
       ->will($this->returnValue(TRUE));
 
-    $image = $this->getMock('Drupal\Core\Image\Image', ['chmod'], [$toolkit, $this->image->getSource()]);
+    $image = $this->getMock(Image::class, ['chmod'], [$toolkit, $this->image->getSource()]);
     $image->expects($this->any())
       ->method('chmod')
       ->will($this->returnValue(FALSE));
diff --git a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
index aefcbb0..7bb5dd1 100644
--- a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Language;
 
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageDefault;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\UnitTestCase;
 
@@ -58,7 +59,7 @@ public function testGetDirection() {
    * @covers ::isDefault
    */
   public function testIsDefault() {
-    $language_default = $this->getMockBuilder('Drupal\Core\Language\LanguageDefault')->disableOriginalConstructor()->getMock();
+    $language_default = $this->getMockBuilder(LanguageDefault::class)->disableOriginalConstructor()->getMock();
     $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
     $container->expects($this->any())
       ->method('get')
diff --git a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
index 242a4ca..b89b029 100644
--- a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
+++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Lock;
 
+use Drupal\Core\Lock\LockBackendAbstract;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -18,7 +19,7 @@ class LockBackendAbstractTest extends UnitTestCase {
   protected $lock;
 
   protected function setUp() {
-    $this->lock = $this->getMockForAbstractClass('Drupal\Core\Lock\LockBackendAbstract');
+    $this->lock = $this->getMockForAbstractClass(LockBackendAbstract::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
index d2b283a..1f40f8b 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
@@ -101,7 +101,7 @@ public function testSortLoggers() {
    * Data provider for self::testLog().
    */
   public function providerTestLog() {
-    $account_mock = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account_mock = $this->getMock(AccountInterface::class);
     $account_mock->expects($this->exactly(2))
       ->method('id')
       ->will($this->returnValue(1));
diff --git a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
index 9ba2fb5..82dae8b 100644
--- a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
@@ -7,10 +7,15 @@
 
 namespace Drupal\Tests\Core\Mail;
 
+use \Drupal\Core\Logger\LoggerChannelFactoryInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Render\RenderContext;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Mail\MailManager;
+use Drupal\Core\Mail\Plugin\Mail\PhpMail;
+use Drupal\Core\Mail\Plugin\Mail\TestMailCollector;
 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 
 /**
@@ -69,11 +74,11 @@ class MailManagerTest extends UnitTestCase {
   protected $definitions = [
     'php_mail' => [
       'id' => 'php_mail',
-      'class' => 'Drupal\Core\Mail\Plugin\Mail\PhpMail',
+      'class' => PhpMail::class,
     ],
     'test_mail_collector' => [
       'id' => 'test_mail_collector',
-      'class' => 'Drupal\Core\Mail\Plugin\Mail\TestMailCollector',
+      'class' => TestMailCollector::class,
     ],
   ];
 
@@ -83,12 +88,12 @@ class MailManagerTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
     // Prepare the default constructor arguments required by MailManager.
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
 
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
     // Mock a Discovery object to replace AnnotationClassDiscovery.
-    $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
+    $this->discovery = $this->getMock(DiscoveryInterface::class);
     $this->discovery->expects($this->any())
       ->method('getDefinitions')
       ->will($this->returnValue($this->definitions));
@@ -104,7 +109,7 @@ protected function setUpMailManager($interface = []) {
         'interface' => $interface,
       ],
     ]);
-    $logger_factory = $this->getMock('\Drupal\Core\Logger\LoggerChannelFactoryInterface');
+    $logger_factory = $this->getMock(LoggerChannelFactoryInterface::class);
     $string_translation = $this->getStringTranslationStub();
     $this->renderer = $this->getMock(RendererInterface::class);
     // Construct the manager object and override its discovery.
@@ -127,12 +132,12 @@ public function testGetInstance() {
     // Test that an unmatched message_id returns the default plugin instance.
     $options = ['module' => 'foo', 'key' => 'bar'];
     $instance = $this->mailManager->getInstance($options);
-    $this->assertInstanceOf('Drupal\Core\Mail\Plugin\Mail\PhpMail', $instance);
+    $this->assertInstanceOf(PhpMail::class, $instance);
 
     // Test that a matching message_id returns the specified plugin instance.
     $options = ['module' => 'example', 'key' => 'testkey'];
     $instance = $this->mailManager->getInstance($options);
-    $this->assertInstanceOf('Drupal\Core\Mail\Plugin\Mail\TestMailCollector', $instance);
+    $this->assertInstanceOf(TestMailCollector::class, $instance);
   }
 
 
diff --git a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
index a956d83..4016e44 100644
--- a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Menu\ContextualLinkDefault;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -53,7 +54,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $this->stringTranslation = $this->getMock(TranslationInterface::class);
   }
 
   protected function setupContextualLinkDefault() {
diff --git a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
index bebc935..d184787 100644
--- a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
@@ -2,10 +2,19 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use \Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Component\Plugin\Exception\PluginException;
+use Drupal\Component\Plugin\Factory\FactoryInterface;
+use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Menu\ContextualLinkDefault;
+use Drupal\Core\Menu\ContextualLinkInterface;
+use Drupal\Core\Menu\ContextualLinkManager;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\RequestStack;
 
@@ -73,54 +82,54 @@ class ContextualLinkManagerTest extends UnitTestCase {
 
   protected function setUp() {
     $this->contextualLinkManager = $this
-      ->getMockBuilder('Drupal\Core\Menu\ContextualLinkManager')
+      ->getMockBuilder(ContextualLinkManager::class)
       ->disableOriginalConstructor()
       ->setMethods(NULL)
       ->getMock();
 
     $this->controllerResolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');
-    $this->pluginDiscovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
-    $this->factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface');
-    $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
-
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'controllerResolver');
+    $this->pluginDiscovery = $this->getMock(DiscoveryInterface::class);
+    $this->factory = $this->getMock(FactoryInterface::class);
+    $this->cacheBackend = $this->getMock(CacheBackendInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
+    $this->account = $this->getMock(AccountInterface::class);
+
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'controllerResolver');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->controllerResolver);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'discovery');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'discovery');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->pluginDiscovery);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'factory');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'factory');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->factory);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'account');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'account');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->account);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'accessManager');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'accessManager');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->accessManager);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'moduleHandler');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'moduleHandler');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $this->moduleHandler);
 
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
     $language_manager->expects($this->any())
       ->method('getCurrentLanguage')
       ->will($this->returnValue(new Language(['id' => 'en'])));
 
     $request_stack = new RequestStack();
-    $property = new \ReflectionProperty('Drupal\Core\Menu\ContextualLinkManager', 'requestStack');
+    $property = new \ReflectionProperty(ContextualLinkManager::class, 'requestStack');
     $property->setAccessible(TRUE);
     $property->setValue($this->contextualLinkManager, $request_stack);
 
-    $method = new \ReflectionMethod('Drupal\Core\Menu\ContextualLinkManager', 'alterInfo');
+    $method = new \ReflectionMethod(ContextualLinkManager::class, 'alterInfo');
     $method->setAccessible(TRUE);
     $method->invoke($this->contextualLinkManager, 'contextual_links_plugins');
 
@@ -136,19 +145,19 @@ public function testGetContextualLinkPluginsByGroup() {
     $definitions = [
       'test_plugin1' => [
         'id' => 'test_plugin1',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'group' => 'group1',
         'route_name' => 'test_route',
       ],
       'test_plugin2' => [
         'id' => 'test_plugin2',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'group' => 'group1',
         'route_name' => 'test_route2',
       ],
       'test_plugin3' => [
         'id' => 'test_plugin3',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'group' => 'group2',
         'route_name' => 'test_router3',
       ],
@@ -175,13 +184,13 @@ public function testGetContextualLinkPluginsByGroupWithCache() {
     $definitions = [
       'test_plugin1' => [
         'id' => 'test_plugin1',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'group' => 'group1',
         'route_name' => 'test_route',
       ],
       'test_plugin2' => [
         'id' => 'test_plugin2',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'group' => 'group1',
         'route_name' => 'test_route2',
       ],
@@ -208,7 +217,7 @@ public function testGetContextualLinkPluginsByGroupWithCache() {
    */
   public function testProcessDefinitionWithoutRoute() {
     $definition = [
-      'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+      'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
       'group' => 'example',
       'id' => 'test_plugin',
     ];
@@ -223,7 +232,7 @@ public function testProcessDefinitionWithoutRoute() {
    */
   public function testProcessDefinitionWithoutGroup() {
     $definition = [
-      'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+      'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
       'route_name' => 'example',
       'id' => 'test_plugin',
     ];
@@ -240,7 +249,7 @@ public function testGetContextualLinksArrayByGroup() {
     $definitions = [
       'test_plugin1' => [
         'id' => 'test_plugin1',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'title' => 'Plugin 1',
         'weight' => 0,
         'group' => 'group1',
@@ -249,7 +258,7 @@ public function testGetContextualLinksArrayByGroup() {
       ],
       'test_plugin2' => [
         'id' => 'test_plugin2',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'title' => 'Plugin 2',
         'weight' => 2,
         'group' => 'group1',
@@ -258,7 +267,7 @@ public function testGetContextualLinksArrayByGroup() {
       ],
       'test_plugin3' => [
         'id' => 'test_plugin3',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'title' => 'Plugin 3',
         'weight' => 5,
         'group' => 'group2',
@@ -278,7 +287,7 @@ public function testGetContextualLinksArrayByGroup() {
     // Set up mocking of the plugin factory.
     $map = [];
     foreach ($definitions as $plugin_id => $definition) {
-      $plugin = $this->getMock('Drupal\Core\Menu\ContextualLinkInterface');
+      $plugin = $this->getMock(ContextualLinkInterface::class);
       $plugin->expects($this->any())
         ->method('getRouteName')
         ->will($this->returnValue($definition['route_name']));
@@ -320,7 +329,7 @@ public function testGetContextualLinksArrayByGroupAccessCheck() {
     $definitions = [
       'test_plugin1' => [
         'id' => 'test_plugin1',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'title' => 'Plugin 1',
         'weight' => 0,
         'group' => 'group1',
@@ -329,7 +338,7 @@ public function testGetContextualLinksArrayByGroupAccessCheck() {
       ],
       'test_plugin2' => [
         'id' => 'test_plugin2',
-        'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+        'class' => \Drupal\Core\Menu\ContextualLinkDefault::class,
         'title' => 'Plugin 2',
         'weight' => 2,
         'group' => 'group1',
@@ -352,7 +361,7 @@ public function testGetContextualLinksArrayByGroupAccessCheck() {
     // Set up mocking of the plugin factory.
     $map = [];
     foreach ($definitions as $plugin_id => $definition) {
-      $plugin = $this->getMock('Drupal\Core\Menu\ContextualLinkInterface');
+      $plugin = $this->getMock(ContextualLinkInterface::class);
       $plugin->expects($this->any())
         ->method('getRouteName')
         ->will($this->returnValue($definition['route_name']));
diff --git a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
index beb7828..6152766 100644
--- a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
@@ -2,13 +2,17 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use \Drupal\Core\Access\AccessManagerInterface;
+use \Drupal\Core\Menu\InaccessibleMenuLink;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\Container;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Core\Menu\DefaultMenuLinkTreeManipulators;
 use Drupal\Core\Menu\MenuLinkTreeElement;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\node\NodeInterface;
 
@@ -69,8 +73,8 @@ class DefaultMenuLinkTreeManipulatorsTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->accessManager = $this->getMock('\Drupal\Core\Access\AccessManagerInterface');
-    $this->currentUser = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
+    $this->currentUser = $this->getMock(AccountInterface::class);
     $this->currentUser->method('isAuthenticated')
       ->willReturn(TRUE);
     $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class);
@@ -186,29 +190,29 @@ public function testCheckAccess() {
     // hence kept.
     $element = $tree[1];
     $this->assertEquals(AccessResult::forbidden()->cachePerPermissions(), $element->access);
-    $this->assertInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 2: route with parameters, access granted.
     $element = $tree[2];
     $this->assertEquals(AccessResult::allowed()->cachePerPermissions(), $element->access);
-    $this->assertNotInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertNotInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 3: route with parameters, AccessResult::neutral(), top-level
     // inaccessible link, hence kept for its cacheability metadata.
     // Note that the permissions cache context is added automatically, because
     // we always check the "link to any page" permission.
     $element = $tree[2]->subtree[3];
     $this->assertEquals(AccessResult::neutral()->cachePerPermissions(), $element->access);
-    $this->assertInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 4: child of menu link 3, which was AccessResult::neutral(),
     // hence menu link 3's subtree is removed, of which this menu link is one.
     $this->assertFalse(array_key_exists(4, $tree[2]->subtree[3]->subtree));
     // Menu link 5: no route name, treated as external, hence access granted.
     $element = $tree[5];
     $this->assertEquals(AccessResult::allowed()->cachePerPermissions(), $element->access);
-    $this->assertNotInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertNotInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 6: external URL, hence access granted.
     $element = $tree[6];
     $this->assertEquals(AccessResult::allowed()->cachePerPermissions(), $element->access);
-    $this->assertNotInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertNotInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 7: 'access' already set: AccessResult::neutral(), top-level
     // inaccessible link, hence kept for its cacheability metadata.
     // Note that unlike for menu link 3, the permission cache context is absent,
@@ -216,12 +220,12 @@ public function testCheckAccess() {
     // already set.
     $element = $tree[5]->subtree[7];
     $this->assertEquals(AccessResult::neutral(), $element->access);
-    $this->assertInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertInstanceOf(InaccessibleMenuLink::class, $element->link);
     // Menu link 8: 'access' already set, note that 'per permissions' caching
     // is not added.
     $element = $tree[8];
     $this->assertEquals(AccessResult::allowed()->cachePerUser(), $element->access);
-    $this->assertNotInstanceOf('\Drupal\Core\Menu\InaccessibleMenuLink', $element->link);
+    $this->assertNotInstanceOf(InaccessibleMenuLink::class, $element->link);
   }
 
   /**
@@ -290,7 +294,7 @@ public function testCheckNodeAccess() {
       6 => new MenuLinkTreeElement($links[6], FALSE, 2, FALSE, []),
     ]);
 
-    $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $query = $this->getMock(QueryInterface::class);
     $query->expects($this->at(0))
       ->method('condition')
       ->with('nid', [1, 2, 3, 4]);
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
index b026fb0..8b84c31 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
@@ -3,7 +3,9 @@
 namespace Drupal\Tests\Core\Menu;
 
 use Drupal\Core\Menu\LocalActionDefault;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -60,8 +62,8 @@ class LocalActionDefaultTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->stringTranslation = $this->getMock(TranslationInterface::class);
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
index 0f1f848..01f6647 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Access\AccessResultForbidden;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Menu\LocalActionInterface;
 use Drupal\Core\Menu\LocalActionManager;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Routing\RouteProviderInterface;
@@ -104,21 +105,21 @@ class LocalActionManagerTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
+    $this->controllerResolver = $this->getMock(\Drupal\Core\Controller\ControllerResolverInterface::class);
     $this->request = $this->getMock('Symfony\Component\HttpFoundation\Request');
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->cacheBackend = $this->getMock(CacheBackendInterface::class);
 
     $access_result = new AccessResultForbidden();
-    $this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
     $this->accessManager->expects($this->any())
       ->method('checkNamedRoute')
       ->willReturn($access_result);
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
-    $this->factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface');
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $this->account = $this->getMock(AccountInterface::class);
+    $this->discovery = $this->getMock(DiscoveryInterface::class);
+    $this->factory = $this->getMock(FactoryInterface::class);
+    $route_match = $this->getMock(RouteMatchInterface::class);
 
     $this->localActionManager = new TestLocalActionManager($this->controllerResolver, $this->request, $route_match, $this->routeProvider, $this->moduleHandler, $this->cacheBackend, $this->accessManager, $this->account, $this->discovery, $this->factory);
   }
@@ -127,7 +128,7 @@ protected function setUp() {
    * @covers ::getTitle
    */
   public function testGetTitle() {
-    $local_action = $this->getMock('Drupal\Core\Menu\LocalActionInterface');
+    $local_action = $this->getMock(LocalActionInterface::class);
     $local_action->expects($this->once())
       ->method('getTitle')
       ->with('test');
@@ -151,7 +152,7 @@ public function testGetActionsForRoute($route_appears, array $plugin_definitions
       ->will($this->returnValue($plugin_definitions));
     $map = [];
     foreach ($plugin_definitions as $plugin_id => $plugin_definition) {
-      $plugin = $this->getMock('Drupal\Core\Menu\LocalActionInterface');
+      $plugin = $this->getMock(LocalActionInterface::class);
       $plugin->expects($this->any())
         ->method('getRouteName')
         ->will($this->returnValue($plugin_definition['route_name']));
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
index 84b91af..aee9d5c 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Routing\RouteMatch;
 use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 
@@ -67,8 +68,8 @@ class LocalTaskDefaultTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->stringTranslation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
+    $this->stringTranslation = $this->getMock(TranslationInterface::class);
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
index 8ac0bbf..3cc1ee6 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
@@ -2,8 +2,15 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use Drupal\Component\Plugin\Factory\FactoryInterface;
+use Drupal\Core\Access\AccessManagerInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Menu\LocalTaskInterface;
+use Drupal\Core\Menu\LocalTaskManager;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Core\Plugin\Discovery\YamlDiscovery;
+use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -56,36 +63,36 @@ protected function setUp() {
    */
   protected function getLocalTaskManager($module_dirs, $route_name, $route_params) {
     $manager = $this
-      ->getMockBuilder('Drupal\Core\Menu\LocalTaskManager')
+      ->getMockBuilder(LocalTaskManager::class)
       ->disableOriginalConstructor()
       ->setMethods(NULL)
       ->getMock();
 
     $controllerResolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'controllerResolver');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'controllerResolver');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $controllerResolver);
 
     // todo mock a request with a route.
     $request_stack = new RequestStack();
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'requestStack');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'requestStack');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $request_stack);
 
-    $accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'accessManager');
+    $accessManager = $this->getMock(AccessManagerInterface::class);
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'accessManager');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $accessManager);
 
-    $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'routeProvider');
+    $route_provider = $this->getMock(RouteProviderInterface::class);
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'routeProvider');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $route_provider);
 
-    $module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface')
+    $module_handler = $this->getMockBuilder(ModuleHandlerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'moduleHandler');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'moduleHandler');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $module_handler);
     // Set all the modules as being existent.
@@ -97,24 +104,24 @@ protected function getLocalTaskManager($module_dirs, $route_name, $route_params)
 
     $pluginDiscovery = new YamlDiscovery('links.task', $module_dirs);
     $pluginDiscovery = new ContainerDerivativeDiscoveryDecorator($pluginDiscovery);
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'discovery');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'discovery');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $pluginDiscovery);
 
-    $method = new \ReflectionMethod('Drupal\Core\Menu\LocalTaskManager', 'alterInfo');
+    $method = new \ReflectionMethod(LocalTaskManager::class, 'alterInfo');
     $method->setAccessible(TRUE);
     $method->invoke($manager, 'local_tasks');
 
-    $plugin_stub = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
-    $factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface');
+    $plugin_stub = $this->getMock(LocalTaskInterface::class);
+    $factory = $this->getMock(FactoryInterface::class);
     $factory->expects($this->any())
       ->method('createInstance')
       ->will($this->returnValue($plugin_stub));
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'factory');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'factory');
     $property->setAccessible(TRUE);
     $property->setValue($manager, $factory);
 
-    $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $cache_backend = $this->getMock(CacheBackendInterface::class);
     $manager->setCacheBackend($cache_backend, 'local_task.en', ['local_task']);
 
     return $manager;
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
index 3d3d501..27289e7 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
@@ -2,15 +2,26 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
+use Drupal\Component\Plugin\Factory\FactoryInterface;
+use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableDependencyInterface;
 use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\Context\CacheContextsManager;
+use Drupal\Core\Controller\ControllerResolverInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Menu\LocalTaskDefault;
 use Drupal\Core\Menu\LocalTaskInterface;
 use Drupal\Core\Menu\LocalTaskManager;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Prophecy\Argument;
 use Symfony\Component\HttpFoundation\ParameterBag;
@@ -99,15 +110,15 @@ class LocalTaskManagerTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
     $this->request = new Request();
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $this->pluginDiscovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
-    $this->factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface');
-    $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
-    $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->routeProvider = $this->getMock(RouteProviderInterface::class);
+    $this->pluginDiscovery = $this->getMock(DiscoveryInterface::class);
+    $this->factory = $this->getMock(FactoryInterface::class);
+    $this->cacheBackend = $this->getMock(CacheBackendInterface::class);
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
+    $this->routeMatch = $this->getMock(RouteMatchInterface::class);
+    $this->account = $this->getMock(AccountInterface::class);
 
     $this->setupLocalTaskManager();
     $this->setupNullCacheabilityMetadataValidation();
@@ -125,7 +136,7 @@ public function testGetLocalTasksForRouteSingleLevelTitle() {
       ->method('getDefinitions')
       ->will($this->returnValue($definitions));
 
-    $mock_plugin = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
+    $mock_plugin = $this->getMock(LocalTaskInterface::class);
 
     $this->setupFactory($mock_plugin);
     $this->setupLocalTaskManager();
@@ -149,7 +160,7 @@ public function testGetLocalTasksForRouteForChild() {
       ->method('getDefinitions')
       ->will($this->returnValue($definitions));
 
-    $mock_plugin = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
+    $mock_plugin = $this->getMock(LocalTaskInterface::class);
 
     $this->setupFactory($mock_plugin);
     $this->setupLocalTaskManager();
@@ -171,7 +182,7 @@ public function testGetLocalTaskForRouteWithEmptyCache() {
       ->method('getDefinitions')
       ->will($this->returnValue($definitions));
 
-    $mock_plugin = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
+    $mock_plugin = $this->getMock(LocalTaskInterface::class);
     $this->setupFactory($mock_plugin);
 
     $this->setupLocalTaskManager();
@@ -207,7 +218,7 @@ public function testGetLocalTaskForRouteWithFilledCache() {
     $this->pluginDiscovery->expects($this->never())
       ->method('getDefinitions');
 
-    $mock_plugin = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
+    $mock_plugin = $this->getMock(LocalTaskInterface::class);
     $this->setupFactory($mock_plugin);
 
     $this->setupLocalTaskManager();
@@ -233,7 +244,7 @@ public function testGetLocalTaskForRouteWithFilledCache() {
    * @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getTitle()
    */
   public function testGetTitle() {
-    $menu_local_task = $this->getMock('Drupal\Core\Menu\LocalTaskInterface');
+    $menu_local_task = $this->getMock(LocalTaskInterface::class);
     $menu_local_task->expects($this->once())
       ->method('getTitle');
 
@@ -251,22 +262,22 @@ public function testGetTitle() {
   protected function setupLocalTaskManager() {
     $request_stack = new RequestStack();
     $request_stack->push($this->request);
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $module_handler->expects($this->any())
       ->method('getModuleDirectories')
       ->willReturn([]);
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $language_manager = $this->getMock(LanguageManagerInterface::class);
     $language_manager->expects($this->any())
       ->method('getCurrentLanguage')
       ->will($this->returnValue(new Language(['id' => 'en'])));
 
     $this->manager = new LocalTaskManager($this->controllerResolver, $request_stack, $this->routeMatch, $this->routeProvider, $module_handler, $this->cacheBackend, $language_manager, $this->accessManager, $this->account);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'discovery');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'discovery');
     $property->setAccessible(TRUE);
     $property->setValue($this->manager, $this->pluginDiscovery);
 
-    $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'factory');
+    $property = new \ReflectionProperty(LocalTaskManager::class, 'factory');
     $property->setAccessible(TRUE);
     $property->setValue($this->manager, $this->factory);
 
@@ -322,7 +333,7 @@ protected function getLocalTaskFixtures() {
         'parent_id' => NULL,
         'weight' => 0,
         'options' => [],
-        'class' => 'Drupal\Core\Menu\LocalTaskDefault',
+        'class' => LocalTaskDefault::class,
       ];
     }
     return $definitions;
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
index c763938..4c627dc 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
@@ -2,7 +2,11 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use \Drupal\Core\Cache\CacheBackendInterface;
+use \Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use \Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\Menu\MenuActiveTrail;
+use Drupal\Core\Menu\MenuLinkManagerInterface;
 use Drupal\Core\Routing\CurrentRouteMatch;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -71,14 +75,14 @@ protected function setUp() {
 
     $this->requestStack = new RequestStack();
     $this->currentRouteMatch = new CurrentRouteMatch($this->requestStack);
-    $this->menuLinkManager = $this->getMock('Drupal\Core\Menu\MenuLinkManagerInterface');
-    $this->cache = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
-    $this->lock = $this->getMock('\Drupal\Core\Lock\LockBackendInterface');
+    $this->menuLinkManager = $this->getMock(MenuLinkManagerInterface::class);
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
 
     $this->menuActiveTrail = new MenuActiveTrail($this->menuLinkManager, $this->currentRouteMatch, $this->cache, $this->lock);
 
     $container = new Container();
-    $container->set('cache_tags.invalidator', $this->getMock('\Drupal\Core\Cache\CacheTagsInvalidatorInterface'));
+    $container->set('cache_tags.invalidator', $this->getMock(CacheTagsInvalidatorInterface::class));
     \Drupal::setContainer($container);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
index 98a122c..176bdba 100644
--- a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Menu;
 
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Menu\StaticMenuLinkOverrides;
 use Drupal\Tests\UnitTestCase;
 
@@ -29,7 +31,7 @@ public function testConstruct() {
    * @covers ::reload
    */
   public function testReload() {
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->at(0))
       ->method('reset')
       ->with('core.menu.static_menu_link_overrides');
@@ -97,7 +99,7 @@ public function testLoadMultipleOverrides() {
    * @covers ::getConfig
    */
   public function testSaveOverride() {
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->at(0))
@@ -141,7 +143,7 @@ public function testSaveOverride() {
     $config->expects($this->at(7))
       ->method('save');
 
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->once())
       ->method('getEditable')
       ->will($this->returnValue($config));
@@ -165,7 +167,7 @@ public function testSaveOverride() {
    * @dataProvider providerTestDeleteOverrides
    */
   public function testDeleteOverrides($ids, array $old_definitions, array $new_definitions) {
-    $config = $this->getMockBuilder('Drupal\Core\Config\Config')
+    $config = $this->getMockBuilder(Config::class)
       ->disableOriginalConstructor()
       ->getMock();
     $config->expects($this->at(0))
@@ -183,7 +185,7 @@ public function testDeleteOverrides($ids, array $old_definitions, array $new_def
         ->method('save');
     }
 
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->once())
       ->method('getEditable')
       ->will($this->returnValue($config));
diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
index 67e99de..cf144c9 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
@@ -48,7 +48,7 @@ public function testEmptyChain() {
    * @covers ::check
    */
   public function testNullRuleChain() {
-    $rule = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+    $rule = $this->getMock(RequestPolicyInterface::class);
     $rule->expects($this->once())
       ->method('check')
       ->with($this->request)
@@ -67,7 +67,7 @@ public function testNullRuleChain() {
    * @covers ::check
    */
   public function testChainExceptionOnInvalidReturnValue($return_value) {
-    $rule = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+    $rule = $this->getMock(RequestPolicyInterface::class);
     $rule->expects($this->once())
       ->method('check')
       ->with($this->request)
@@ -104,7 +104,7 @@ public function providerChainExceptionOnInvalidReturnValue() {
    */
   public function testAllowIfAnyRuleReturnedAllow($return_values) {
     foreach ($return_values as $return_value) {
-      $rule = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+      $rule = $this->getMock(RequestPolicyInterface::class);
       $rule->expects($this->once())
         ->method('check')
         ->with($this->request)
@@ -134,21 +134,21 @@ public function providerAllowIfAnyRuleReturnedAllow() {
    * Asserts that check() returns immediately when a rule returned DENY.
    */
   public function testStopChainOnFirstDeny() {
-    $rule1 = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+    $rule1 = $this->getMock(RequestPolicyInterface::class);
     $rule1->expects($this->once())
       ->method('check')
       ->with($this->request)
       ->will($this->returnValue(RequestPolicyInterface::ALLOW));
     $this->policy->addPolicy($rule1);
 
-    $deny_rule = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+    $deny_rule = $this->getMock(RequestPolicyInterface::class);
     $deny_rule->expects($this->once())
       ->method('check')
       ->with($this->request)
       ->will($this->returnValue(RequestPolicyInterface::DENY));
     $this->policy->addPolicy($deny_rule);
 
-    $ignored_rule = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface');
+    $ignored_rule = $this->getMock(RequestPolicyInterface::class);
     $ignored_rule->expects($this->never())
       ->method('check');
     $this->policy->addPolicy($ignored_rule);
diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
index 8de3a5c..3f94fc2 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
@@ -57,7 +57,7 @@ public function testEmptyChain() {
    * @covers ::check
    */
   public function testNullRuleChain() {
-    $rule = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');
+    $rule = $this->getMock(ResponsePolicyInterface::class);
     $rule->expects($this->once())
       ->method('check')
       ->with($this->response, $this->request)
@@ -76,7 +76,7 @@ public function testNullRuleChain() {
    * @covers ::check
    */
   public function testChainExceptionOnInvalidReturnValue($return_value) {
-    $rule = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');
+    $rule = $this->getMock(ResponsePolicyInterface::class);
     $rule->expects($this->once())
       ->method('check')
       ->with($this->response, $this->request)
@@ -109,20 +109,20 @@ public function providerChainExceptionOnInvalidReturnValue() {
    * Asserts that check() returns immediately when a rule returned DENY.
    */
   public function testStopChainOnFirstDeny() {
-    $rule1 = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');
+    $rule1 = $this->getMock(ResponsePolicyInterface::class);
     $rule1->expects($this->once())
       ->method('check')
       ->with($this->response, $this->request);
     $this->policy->addPolicy($rule1);
 
-    $deny_rule = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');
+    $deny_rule = $this->getMock(ResponsePolicyInterface::class);
     $deny_rule->expects($this->once())
       ->method('check')
       ->with($this->response, $this->request)
       ->will($this->returnValue(ResponsePolicyInterface::DENY));
     $this->policy->addPolicy($deny_rule);
 
-    $ignored_rule = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');
+    $ignored_rule = $this->getMock(ResponsePolicyInterface::class);
     $ignored_rule->expects($this->never())
       ->method('check');
     $this->policy->addPolicy($ignored_rule);
diff --git a/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php b/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
index 46f78c6..6b8c22f 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\PageCache;
 
+use Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod;
 use Drupal\Core\PageCache\RequestPolicyInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
@@ -22,7 +23,7 @@ class CommandLineOrUnsafeMethodTest extends UnitTestCase {
   protected function setUp() {
     // Note that it is necessary to partially mock the class under test in
     // order to disable the isCli-check.
-    $this->policy = $this->getMock('Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod', ['isCli']);
+    $this->policy = $this->getMock(CommandLineOrUnsafeMethod::class, ['isCli']);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php b/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
index f4ae1c9..161f981 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\PageCache\RequestPolicy\NoSessionOpen;
 use Drupal\Core\PageCache\RequestPolicyInterface;
+use Drupal\Core\Session\SessionConfigurationInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -28,7 +29,7 @@ class NoSessionOpenTest extends UnitTestCase {
   protected $policy;
 
   protected function setUp() {
-    $this->sessionConfiguration = $this->getMock('Drupal\Core\Session\SessionConfigurationInterface');
+    $this->sessionConfiguration = $this->getMock(SessionConfigurationInterface::class);
     $this->policy = new NoSessionOpen($this->sessionConfiguration);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
index 67decbe..571f93d 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\ParamConverter;
 
 use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\ParamConverter\EntityConverter;
 use Drupal\Core\ParamConverter\ParamNotConvertedException;
 use Drupal\Tests\UnitTestCase;
@@ -35,7 +37,7 @@ class EntityConverterTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager = $this->getMock(EntityManagerInterface::class);
 
     $this->entityConverter = new EntityConverter($this->entityManager);
   }
@@ -79,7 +81,7 @@ public function providerTestApplies() {
    * @covers ::convert
    */
   public function testConvert($value, array $definition, array $defaults, $expected_result) {
-    $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
+    $entity_storage = $this->getMock(EntityStorageInterface::class);
     $this->entityManager->expects($this->once())
       ->method('getStorage')
       ->with('entity_test')
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
index 6d60e1d..f44d0b0 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\ParamConverter;
 
+use Drupal\Core\ParamConverter\ParamConverterInterface;
 use Drupal\Core\ParamConverter\ParamConverterManager;
 use Drupal\Core\ParamConverter\ParamNotConvertedException;
 use Drupal\Tests\UnitTestCase;
@@ -37,7 +38,7 @@ protected function setUp() {
    * @covers ::getConverter
    */
   public function testGetConverter($name, $class) {
-    $converter = $this->getMockBuilder('Drupal\Core\ParamConverter\ParamConverterInterface')
+    $converter = $this->getMockBuilder(ParamConverterInterface::class)
       ->setMockClassName($class)
       ->getMock();
 
@@ -128,7 +129,7 @@ public function providerTestGetConverter() {
    * @dataProvider providerTestSetRouteParameterConverters
    */
   public function testSetRouteParameterConverters($path, $parameters = NULL, $expected = NULL) {
-    $converter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterInterface');
+    $converter = $this->getMock(ParamConverterInterface::class);
     $converter->expects($this->any())
       ->method('applies')
       ->with($this->anything(), 'id', $this->anything())
@@ -190,7 +191,7 @@ public function testConvert() {
     $expected = $defaults;
     $expected['id'] = 'something_better!';
 
-    $converter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterInterface');
+    $converter = $this->getMock(ParamConverterInterface::class);
     $converter->expects($this->any())
       ->method('convert')
       ->with(1, $this->isType('array'), 'id', $this->isType('array'))
@@ -236,7 +237,7 @@ public function testConvertMissingParam() {
       'id' => 1,
     ];
 
-    $converter = $this->getMock('Drupal\Core\ParamConverter\ParamConverterInterface');
+    $converter = $this->getMock(ParamConverterInterface::class);
     $converter->expects($this->any())
       ->method('convert')
       ->with(1, $this->isType('array'), 'id', $this->isType('array'))
diff --git a/core/tests/Drupal/Tests/Core/Path/AliasManagerTest.php b/core/tests/Drupal/Tests/Core/Path/AliasManagerTest.php
index ffd52dc..bf8016e 100644
--- a/core/tests/Drupal/Tests/Core/Path/AliasManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Path/AliasManagerTest.php
@@ -2,9 +2,13 @@
 
 namespace Drupal\Tests\Core\Path;
 
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Path\AliasManager;
+use Drupal\Core\Path\AliasStorageInterface;
+use Drupal\Core\Path\AliasWhitelistInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -68,10 +72,10 @@ class AliasManagerTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->aliasStorage = $this->getMock('Drupal\Core\Path\AliasStorageInterface');
-    $this->aliasWhitelist = $this->getMock('Drupal\Core\Path\AliasWhitelistInterface');
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $this->aliasStorage = $this->getMock(AliasStorageInterface::class);
+    $this->aliasWhitelist = $this->getMock(AliasWhitelistInterface::class);
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
+    $this->cache = $this->getMock(CacheBackendInterface::class);
 
     $this->aliasManager = new AliasManager($this->aliasStorage, $this->aliasWhitelist, $this->languageManager, $this->cache);
 
diff --git a/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php b/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
index 7089121..7bbf20a 100644
--- a/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Path;
 
 use Drupal\Core\Path\PathMatcher;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -31,7 +32,7 @@ protected function setUp() {
         ],
       ]
     );
-    $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
+    $route_match = $this->getMock(RouteMatchInterface::class);
     $this->pathMatcher = new PathMatcher($config_factory_stub, $route_match);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
index 2bfb1c9..2826bcc 100644
--- a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
@@ -2,8 +2,12 @@
 
 namespace Drupal\Tests\Core\Path;
 
+use Drupal\Core\Url;
 use Drupal\Core\ParamConverter\ParamNotConvertedException;
 use Drupal\Core\Path\PathValidator;
+use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
+use Drupal\Core\Routing\AccessAwareRouterInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\ParameterBag;
@@ -57,10 +61,10 @@ class PathValidatorTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->accessAwareRouter = $this->getMock('Drupal\Core\Routing\AccessAwareRouterInterface');
+    $this->accessAwareRouter = $this->getMock(AccessAwareRouterInterface::class);
     $this->accessUnawareRouter = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
-    $this->account = $this->getMock('Drupal\Core\Session\AccountInterface');
-    $this->pathProcessor = $this->getMock('Drupal\Core\PathProcessor\InboundPathProcessorInterface');
+    $this->account = $this->getMock(AccountInterface::class);
+    $this->pathProcessor = $this->getMock(InboundPathProcessorInterface::class);
     $this->pathValidator = new PathValidator($this->accessAwareRouter, $this->accessUnawareRouter, $this->account, $this->pathProcessor);
   }
 
@@ -341,14 +345,14 @@ public function testGetUrlIfValidWithAccess() {
       ->willReturnArgument(0);
 
     $url = $this->pathValidator->getUrlIfValid('test-path');
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
 
     $this->assertEquals('test_route', $url->getRouteName());
     $this->assertEquals(['key' => 'value'], $url->getRouteParameters());
 
     // Test with leading /.
     $url = $this->pathValidator->getUrlIfValid('/test-path');
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
 
     $this->assertEquals('test_route', $url->getRouteName());
     $this->assertEquals(['key' => 'value'], $url->getRouteParameters());
@@ -374,7 +378,7 @@ public function testGetUrlIfValidWithQuery() {
       ->willReturnArgument(0);
 
     $url = $this->pathValidator->getUrlIfValid('test-path?k=bar');
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
 
     $this->assertEquals('test_route', $url->getRouteName());
     $this->assertEquals(['k' => 'bar'], $url->getOptions()['query']);
@@ -437,7 +441,7 @@ public function testGetUrlIfValidWithoutAccessCheck() {
       ->willReturnArgument(0);
 
     $url = $this->pathValidator->getUrlIfValidWithoutAccessCheck('test-path');
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
 
     $this->assertEquals('test_route', $url->getRouteName());
     $this->assertEquals(['key' => 'value'], $url->getRouteParameters());
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorAliasTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorAliasTest.php
index 0473d79..a4318a8 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorAliasTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorAliasTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\PathProcessor;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Core\PathProcessor\PathProcessorAlias;
 use Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Tests\UnitTestCase;
@@ -29,7 +30,7 @@ class PathProcessorAliasTest extends UnitTestCase {
   protected $pathProcessor;
 
   protected function setUp() {
-    $this->aliasManager = $this->getMock('Drupal\Core\Path\AliasManagerInterface');
+    $this->aliasManager = $this->getMock(AliasManagerInterface::class);
     $this->pathProcessor = new PathProcessorAlias($this->aliasManager);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
index 57dfbfa..5e462e6 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
@@ -4,10 +4,12 @@
 
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Path\AliasManager;
 use Drupal\Core\PathProcessor\PathProcessorAlias;
 use Drupal\Core\PathProcessor\PathProcessorDecode;
 use Drupal\Core\PathProcessor\PathProcessorFront;
 use Drupal\Core\PathProcessor\PathProcessorManager;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\language\HttpKernel\PathProcessorLanguage;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
 use Symfony\Component\HttpFoundation\Request;
@@ -93,7 +95,7 @@ protected function setUp() {
   public function testProcessInbound() {
 
     // Create an alias manager stub.
-    $alias_manager = $this->getMockBuilder('Drupal\Core\Path\AliasManager')
+    $alias_manager = $this->getMockBuilder(AliasManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -143,7 +145,7 @@ public function testProcessInbound() {
       ->will($this->returnValue($method));
 
     // Create a user stub.
-    $current_user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface')
+    $current_user = $this->getMockBuilder(AccountInterface::class)
       ->getMock();
 
     // Create a config event subscriber stub.
diff --git a/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
index db67ad7..9f57a5ec 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
@@ -30,7 +30,7 @@ class CategorizingPluginManagerTraitTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $module_handler->expects($this->any())
       ->method('getModuleList')
       ->willReturn(['node' => []]);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
index 6eda2e3..42eac50 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Plugin\Context;
 
+use \Drupal\Core\TypedData\ListDataDefinitionInterface;
 use Drupal\Core\Plugin\Context\ContextDefinition;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
 use Drupal\Tests\UnitTestCase;
@@ -32,7 +33,7 @@ public function providerGetDataDefinition() {
    */
   public function testGetDataDefinition($is_multiple) {
     $data_type = 'valid';
-    $mock_data_definition = $this->getMockBuilder('\Drupal\Core\TypedData\ListDataDefinitionInterface')
+    $mock_data_definition = $this->getMockBuilder(ListDataDefinitionInterface::class)
       ->setMethods([
         'setLabel',
         'setDescription',
@@ -74,7 +75,7 @@ public function testGetDataDefinition($is_multiple) {
 
     // Mock a ContextDefinition object, setting up expectations for many of the
     // methods.
-    $mock_context_definition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinition')
+    $mock_context_definition = $this->getMockBuilder(ContextDefinition::class)
       ->disableOriginalConstructor()
       ->setMethods([
         'isMultiple',
@@ -116,7 +117,7 @@ public function testGetDataDefinitionInvalidType($is_multiple) {
     // Since we're trying to make getDataDefinition() throw an exception in
     // isolation, we use a data type which is not valid.
     $data_type = 'not_valid';
-    $mock_data_definition = $this->getMockBuilder('\Drupal\Core\TypedData\ListDataDefinitionInterface')
+    $mock_data_definition = $this->getMockBuilder(ListDataDefinitionInterface::class)
       ->getMockForAbstractClass();
 
     // Follow code paths for both multiple and non-multiple definitions.
@@ -136,7 +137,7 @@ public function testGetDataDefinitionInvalidType($is_multiple) {
 
     // Mock a ContextDefinition object with expectations for only the methods
     // that will be called before the expected exception.
-    $mock_context_definition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinition')
+    $mock_context_definition = $this->getMockBuilder(ContextDefinition::class)
       ->disableOriginalConstructor()
       ->setMethods([
         'isMultiple',
@@ -180,7 +181,7 @@ public function providerGetConstraint() {
    * @uses \Drupal
    */
   public function testGetConstraint($expected, $constraint_array, $constraint) {
-    $mock_context_definition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinition')
+    $mock_context_definition = $this->getMockBuilder(ContextDefinition::class)
       ->disableOriginalConstructor()
       ->setMethods([
         'getConstraints',
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
index e9b5964..1d32ce1 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
@@ -9,6 +9,8 @@
 
 use Drupal\Core\Cache\CacheableDependencyInterface;
 use Drupal\Core\Plugin\Context\Context;
+use Drupal\Core\Plugin\Context\ContextDefinitionInterface;
+use Drupal\Core\TypedData\DataDefinitionInterface;
 use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\Core\TypedData\TypedDataManagerInterface;
 use Drupal\Tests\UnitTestCase;
@@ -88,11 +90,11 @@ public function testNullDataValue() {
    */
   public function testSetContextValueTypedData() {
 
-    $this->contextDefinition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinitionInterface')
+    $this->contextDefinition = $this->getMockBuilder(ContextDefinitionInterface::class)
       ->setMethods(['getDefaultValue', 'getDataDefinition'])
       ->getMockForAbstractClass();
 
-    $typed_data = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $typed_data = $this->getMock(TypedDataInterface::class);
     $context = new Context($this->contextDefinition, $typed_data);
     $this->assertSame($typed_data, $context->getContextData());
   }
@@ -112,7 +114,7 @@ public function testSetContextValueCacheableDependency() {
       ->willReturn(['route']);
     \Drupal::setContainer($container);
 
-    $this->contextDefinition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $this->contextDefinition = $this->getMock(ContextDefinitionInterface::class);
 
     $context = new Context($this->contextDefinition);
     $context->setTypedDataManager($this->typedDataManager);
@@ -141,9 +143,9 @@ public function testSetContextValueCacheableDependency() {
    *   The default value to assign to the mock context definition.
    */
   protected function setUpDefaultValue($default_value = NULL) {
-    $mock_data_definition = $this->getMock('Drupal\Core\TypedData\DataDefinitionInterface');
+    $mock_data_definition = $this->getMock(DataDefinitionInterface::class);
 
-    $this->contextDefinition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinitionInterface')
+    $this->contextDefinition = $this->getMockBuilder(ContextDefinitionInterface::class)
       ->setMethods(['getDefaultValue', 'getDataDefinition'])
       ->getMockForAbstractClass();
 
@@ -155,7 +157,7 @@ protected function setUpDefaultValue($default_value = NULL) {
       ->method('getDataDefinition')
       ->willReturn($mock_data_definition);
 
-    $this->typedData = $this->getMock('Drupal\Core\TypedData\TypedDataInterface');
+    $this->typedData = $this->getMock(TypedDataInterface::class);
 
     $this->typedDataManager->expects($this->once())
       ->method('create')
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
index 6fe21c1..4dac0b9 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Plugin\Context;
 
+use \Drupal\Core\Plugin\Context\ContextProviderInterface;
 use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\Context\ContextDefinition;
 use Drupal\Core\Plugin\Context\LazyContextRepository;
@@ -80,7 +81,7 @@ public function testGetRuntimeStaticCache() {
     $context0 = new Context(new ContextDefinition('example'));
     $context1 = new Context(new ContextDefinition('example'));
 
-    $context_provider = $this->prophesize('\Drupal\Core\Plugin\Context\ContextProviderInterface');
+    $context_provider = $this->prophesize(ContextProviderInterface::class);
     $context_provider->getRuntimeContexts(['test_context0', 'test_context1'])
       ->shouldBeCalledTimes(1)
       ->willReturn(['test_context0' => $context0, 'test_context1' => $context1]);
@@ -132,7 +133,7 @@ protected function setupContextAndProvider($service_id, array $unqualified_conte
 
     $expected_unqualified_context_ids = $expected_unqualified_context_ids ?: $unqualified_context_ids;
 
-    $context_provider = $this->prophesize('\Drupal\Core\Plugin\Context\ContextProviderInterface');
+    $context_provider = $this->prophesize(ContextProviderInterface::class);
     $context_provider->getRuntimeContexts($expected_unqualified_context_ids)
       ->willReturn(array_combine($unqualified_context_ids, $contexts));
     $context_provider->getAvailableContexts()
diff --git a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
index 4ed5e6e..ad76b75 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
@@ -10,7 +10,9 @@
 use Drupal\Component\Plugin\ConfigurablePluginInterface;
 use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\Core\Plugin\Context\ContextDefinitionInterface;
 use Drupal\Core\Plugin\Context\ContextHandler;
+use Drupal\Core\Plugin\Context\ContextInterface;
 use Drupal\Core\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\Plugin\DataType\StringData;
@@ -57,7 +59,7 @@ public function providerTestCheckRequirements() {
     $requirement_any = new ContextDefinition();
     $requirement_any->setRequired(TRUE);
 
-    $context_any = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_any = $this->getMock(ContextInterface::class);
     $context_any->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('empty')));
@@ -65,18 +67,18 @@ public function providerTestCheckRequirements() {
     $requirement_specific = new ContextDefinition('specific');
     $requirement_specific->setConstraints(['bar' => 'baz']);
 
-    $context_constraint_mismatch = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_constraint_mismatch = $this->getMock(ContextInterface::class);
     $context_constraint_mismatch->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('foo')));
-    $context_datatype_mismatch = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_datatype_mismatch = $this->getMock(ContextInterface::class);
     $context_datatype_mismatch->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('fuzzy')));
 
     $context_definition_specific = new ContextDefinition('specific');
     $context_definition_specific->setConstraints(['bar' => 'baz']);
-    $context_specific = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_specific = $this->getMock(ContextInterface::class);
     $context_specific->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue($context_definition_specific));
@@ -115,21 +117,21 @@ public function providerTestGetMatchingContexts() {
     $requirement_specific = new ContextDefinition('specific');
     $requirement_specific->setConstraints(['bar' => 'baz']);
 
-    $context_any = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_any = $this->getMock(ContextInterface::class);
     $context_any->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('empty')));
-    $context_constraint_mismatch = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_constraint_mismatch = $this->getMock(ContextInterface::class);
     $context_constraint_mismatch->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('foo')));
-    $context_datatype_mismatch = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_datatype_mismatch = $this->getMock(ContextInterface::class);
     $context_datatype_mismatch->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue(new ContextDefinition('fuzzy')));
     $context_definition_specific = new ContextDefinition('specific');
     $context_definition_specific->setConstraints(['bar' => 'baz']);
-    $context_specific = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_specific = $this->getMock(ContextInterface::class);
     $context_specific->expects($this->atLeastOnce())
       ->method('getContextDefinition')
       ->will($this->returnValue($context_definition_specific));
@@ -157,7 +159,7 @@ public function providerTestGetMatchingContexts() {
    */
   public function testFilterPluginDefinitionsByContexts($has_context, $definitions, $expected) {
     if ($has_context) {
-      $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+      $context = $this->getMock(ContextInterface::class);
       $expected_context_definition = (new ContextDefinition('expected_data_type'))->setConstraints(['expected_constraint_name' => 'expected_constraint_value']);
       $context->expects($this->atLeastOnce())
         ->method('getContextDefinition')
@@ -234,7 +236,7 @@ public function providerTestFilterPluginDefinitionsByContexts() {
   public function testApplyContextMapping() {
     $context_hit_data = StringData::createInstance(DataDefinition::create('string'));
     $context_hit_data->setValue('foo');
-    $context_hit = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_hit = $this->getMock(ContextInterface::class);
     $context_hit->expects($this->atLeastOnce())
       ->method('getContextData')
       ->will($this->returnValue($context_hit_data));
@@ -243,7 +245,7 @@ public function testApplyContextMapping() {
     $context_hit->expects($this->atLeastOnce())
       ->method('hasContextValue')
       ->willReturn(TRUE);
-    $context_miss = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context_miss = $this->getMock(ContextInterface::class);
     $context_miss->expects($this->never())
       ->method('getContextData');
 
@@ -252,9 +254,9 @@ public function testApplyContextMapping() {
       'miss' => $context_miss,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
 
-    $plugin = $this->getMock('Drupal\Core\Plugin\ContextAwarePluginInterface');
+    $plugin = $this->getMock(ContextAwarePluginInterface::class);
     $plugin->expects($this->once())
       ->method('getContextMapping')
       ->willReturn([]);
@@ -266,7 +268,7 @@ public function testApplyContextMapping() {
       ->with('hit', $context_hit_data);
 
     // Make sure that the cacheability metadata is passed to the plugin context.
-    $plugin_context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $plugin_context = $this->getMock(ContextInterface::class);
     $plugin_context->expects($this->once())
       ->method('addCacheableDependency')
       ->with($context_hit);
@@ -282,7 +284,7 @@ public function testApplyContextMapping() {
    * @covers ::applyContextMapping
    */
   public function testApplyContextMappingMissingRequired() {
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->never())
       ->method('getContextValue');
 
@@ -290,7 +292,7 @@ public function testApplyContextMappingMissingRequired() {
       'name' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
     $context_definition->expects($this->atLeastOnce())
       ->method('isRequired')
       ->willReturn(TRUE);
@@ -317,7 +319,7 @@ public function testApplyContextMappingMissingRequired() {
    * @covers ::applyContextMapping
    */
   public function testApplyContextMappingMissingNotRequired() {
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->never())
       ->method('getContextValue');
 
@@ -325,7 +327,7 @@ public function testApplyContextMappingMissingNotRequired() {
       'name' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
     $context_definition->expects($this->atLeastOnce())
       ->method('isRequired')
       ->willReturn(FALSE);
@@ -351,7 +353,7 @@ public function testApplyContextMappingMissingNotRequired() {
    * @covers ::applyContextMapping
    */
   public function testApplyContextMappingNoValueRequired() {
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->never())
       ->method('getContextValue');
     $context->expects($this->atLeastOnce())
@@ -362,7 +364,7 @@ public function testApplyContextMappingNoValueRequired() {
       'hit' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
     $context_definition->expects($this->atLeastOnce())
       ->method('isRequired')
       ->willReturn(TRUE);
@@ -386,7 +388,7 @@ public function testApplyContextMappingNoValueRequired() {
    * @covers ::applyContextMapping
    */
   public function testApplyContextMappingNoValueNonRequired() {
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->never())
       ->method('getContextValue');
     $context->expects($this->atLeastOnce())
@@ -397,7 +399,7 @@ public function testApplyContextMappingNoValueNonRequired() {
       'hit' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
     $context_definition->expects($this->atLeastOnce())
       ->method('isRequired')
       ->willReturn(FALSE);
@@ -421,7 +423,7 @@ public function testApplyContextMappingNoValueNonRequired() {
   public function testApplyContextMappingConfigurableAssigned() {
     $context_data = StringData::createInstance(DataDefinition::create('string'));
     $context_data->setValue('foo');
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->atLeastOnce())
       ->method('getContextData')
       ->will($this->returnValue($context_data));
@@ -433,7 +435,7 @@ public function testApplyContextMappingConfigurableAssigned() {
       'name' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
 
     $plugin = $this->getMock('Drupal\Tests\Core\Plugin\TestConfigurableContextAwarePluginInterface');
     $plugin->expects($this->once())
@@ -447,7 +449,7 @@ public function testApplyContextMappingConfigurableAssigned() {
       ->with('hit', $context_data);
 
     // Make sure that the cacheability metadata is passed to the plugin context.
-    $plugin_context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $plugin_context = $this->getMock(ContextInterface::class);
     $plugin_context->expects($this->once())
       ->method('addCacheableDependency')
       ->with($context);
@@ -463,7 +465,7 @@ public function testApplyContextMappingConfigurableAssigned() {
    * @covers ::applyContextMapping
    */
   public function testApplyContextMappingConfigurableAssignedMiss() {
-    $context = $this->getMock('Drupal\Core\Plugin\Context\ContextInterface');
+    $context = $this->getMock(ContextInterface::class);
     $context->expects($this->never())
       ->method('getContextValue');
 
@@ -471,7 +473,7 @@ public function testApplyContextMappingConfigurableAssignedMiss() {
       'name' => $context,
     ];
 
-    $context_definition = $this->getMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
+    $context_definition = $this->getMock(ContextDefinitionInterface::class);
 
     $plugin = $this->getMock('Drupal\Tests\Core\Plugin\TestConfigurableContextAwarePluginInterface');
     $plugin->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
index c65de35..7075e9d 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
@@ -4,6 +4,10 @@
 
 use Drupal\Component\Plugin\Definition\PluginDefinition;
 use Drupal\Component\Plugin\Exception\PluginException;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Cache\MemoryBackend;
+use Drupal\Core\Extension\ModuleHandler;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
@@ -75,7 +79,7 @@ public function testDefaultPluginManagerWithPluginExtendingNonInstalledClass() {
       'provider' => 'plugin_test',
     ];
 
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $plugin_manager = new TestPluginManager($this->namespaces, $definitions, $module_handler, 'test_alter_hook', '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface');
     $plugin_manager->getDefinition('plugin_test', FALSE);
     $this->assertTrue(TRUE, 'No PHP fatal error occurred when retrieving the definitions of a module with plugins that depend on a non-installed module class should not cause a PHP fatal.');
@@ -94,7 +98,7 @@ public function testDefaultPluginManagerWithDisabledModule() {
       'provider' => 'disabled_module',
     ];
 
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
 
     $module_handler->expects($this->once())
       ->method('moduleExists')
@@ -119,7 +123,7 @@ public function testDefaultPluginManagerWithObjects() {
       'provider' => 'disabled_module',
     ];
 
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
 
     $module_handler->expects($this->once())
       ->method('moduleExists')
@@ -144,7 +148,7 @@ public function testDefaultPluginManager() {
    * Tests the plugin manager with no cache and altering.
    */
   public function testDefaultPluginManagerWithAlter() {
-    $module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandler')
+    $module_handler = $this->getMockBuilder(ModuleHandler::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -165,7 +169,7 @@ public function testDefaultPluginManagerWithAlter() {
    */
   public function testDefaultPluginManagerWithEmptyCache() {
     $cid = $this->randomMachineName();
-    $cache_backend = $this->getMockBuilder('Drupal\Core\Cache\MemoryBackend')
+    $cache_backend = $this->getMockBuilder(MemoryBackend::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_backend
@@ -190,7 +194,7 @@ public function testDefaultPluginManagerWithEmptyCache() {
    */
   public function testDefaultPluginManagerWithFilledCache() {
     $cid = $this->randomMachineName();
-    $cache_backend = $this->getMockBuilder('Drupal\Core\Cache\MemoryBackend')
+    $cache_backend = $this->getMockBuilder(MemoryBackend::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_backend
@@ -215,7 +219,7 @@ public function testDefaultPluginManagerNoCache() {
     $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, NULL, NULL, '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface');
 
     $cid = $this->randomMachineName();
-    $cache_backend = $this->getMockBuilder('Drupal\Core\Cache\MemoryBackend')
+    $cache_backend = $this->getMockBuilder(MemoryBackend::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_backend
@@ -237,8 +241,8 @@ public function testDefaultPluginManagerNoCache() {
    */
   public function testCacheClearWithTags() {
     $cid = $this->randomMachineName();
-    $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $cache_tags_invalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $cache_backend = $this->getMock(CacheBackendInterface::class);
+    $cache_tags_invalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
     $cache_tags_invalidator
       ->expects($this->once())
       ->method('invalidateTags')
@@ -274,7 +278,7 @@ public function testCreateInstanceWithJustValidInterfaces() {
    * @covers ::createInstance
    */
   public function testCreateInstanceWithInvalidInterfaces() {
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
 
     $module_handler->expects($this->any())
       ->method('moduleExists')
@@ -302,7 +306,7 @@ public function testCreateInstanceWithInvalidInterfaces() {
    * @covers ::getDefinitions
    */
   public function testGetDefinitionsWithoutRequiredInterface() {
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
 
     $module_handler->expects($this->any())
       ->method('moduleExists')
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
index 508fdc6..be74595 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Tests\UnitTestCase;
 
@@ -36,7 +37,7 @@ public function testGetDefinitions() {
       'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery',
     ];
 
-    $discovery_main = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
+    $discovery_main = $this->getMock(DiscoveryInterface::class);
     $discovery_main->expects($this->any())
       ->method('getDefinitions')
       ->will($this->returnValue($definitions));
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
index e4ea645..bcaa2ab 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Plugin\Definition\DerivablePluginDefinitionInterface;
 use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Component\Plugin\Exception\InvalidDeriverException;
 use Drupal\Tests\UnitTestCase;
 
@@ -27,7 +28,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->discoveryMain = $discovery_main = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
+    $this->discoveryMain = $discovery_main = $this->getMock(DiscoveryInterface::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
index 9f4eb95..dd86d5d 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Plugin\Discovery;
 
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\Discovery\HookDiscovery;
 use Drupal\Tests\UnitTestCase;
 
@@ -30,7 +31,7 @@ class HookDiscoveryTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
     $this->hookDiscovery = new HookDiscovery($this->moduleHandler, 'test_plugin');
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
index ea19368..a46717b 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Plugin\Discovery;
 
+use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\Plugin\Discovery\YamlDiscoveryDecorator;
 
@@ -56,7 +57,7 @@ protected function setUp() {
       ],
     ];
 
-    $decorated = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface');
+    $decorated = $this->getMock(DiscoveryInterface::class);
     $decorated->expects($this->once())
       ->method('getDefinitions')
       ->will($this->returnValue($definitions));
diff --git a/core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php b/core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php
index 1974e4a..f0b94ee 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Plugin;
 
+use Drupal\Component\Plugin\PluginInspectionInterface;
+use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\Core\Plugin\DefaultLazyPluginCollection;
 use Drupal\Tests\UnitTestCase;
 
@@ -43,7 +45,7 @@
   ];
 
   protected function setUp() {
-    $this->pluginManager = $this->getMock('Drupal\Component\Plugin\PluginManagerInterface');
+    $this->pluginManager = $this->getMock(PluginManagerInterface::class);
     $this->pluginManager->expects($this->any())
       ->method('getDefinitions')
       ->will($this->returnValue($this->getPluginDefinitions()));
@@ -102,7 +104,7 @@ public function returnPluginMap($plugin_id) {
    */
   protected function getPluginMock($plugin_id, array $definition) {
     // Create a mock plugin instance.
-    $mock = $this->getMock('Drupal\Component\Plugin\PluginInspectionInterface');
+    $mock = $this->getMock(PluginInspectionInterface::class);
     $mock->expects($this->any())
       ->method('getPluginId')
       ->will($this->returnValue($plugin_id));
diff --git a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
index fd72dac..c784e14 100644
--- a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
+++ b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core;
 
 use Drupal\Core\PrivateKey;
+use Drupal\Core\State\StateInterface;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Component\Utility\Crypt;
 
@@ -41,7 +42,7 @@ protected function setUp() {
     parent::setUp();
     $this->key = Crypt::randomBytesBase64(55);
 
-    $this->state = $this->getMock('Drupal\Core\State\StateInterface');
+    $this->state = $this->getMock(StateInterface::class);
 
     $this->privateKey = new PrivateKey($this->state);
   }
diff --git a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
index 7188a51..18b19dc 100644
--- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
@@ -4,7 +4,9 @@
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Render\BubbleableMetadata;
+use Drupal\Core\Render\Renderer;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -36,7 +38,7 @@ public function testMerge(BubbleableMetadata $a, CacheableMetadata $b, Bubbleabl
     // BubbleableMetadata object, that BubbleableMetadata::merge() doesn't
     // attempt to merge assets.
     if (!$b instanceof BubbleableMetadata) {
-      $renderer = $this->getMockBuilder('Drupal\Core\Render\Renderer')
+      $renderer = $this->getMockBuilder(Renderer::class)
         ->disableOriginalConstructor()
         ->getMock();
       $renderer->expects($this->never())
@@ -44,13 +46,13 @@ public function testMerge(BubbleableMetadata $a, CacheableMetadata $b, Bubbleabl
     }
     // Otherwise, let the original ::mergeAttachments() method be executed.
     else {
-      $renderer = $this->getMockBuilder('Drupal\Core\Render\Renderer')
+      $renderer = $this->getMockBuilder(Renderer::class)
         ->disableOriginalConstructor()
         ->setMethods(NULL)
         ->getMock();
     }
 
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -655,7 +657,7 @@ public function providerTestMergeAttachmentsHttpHeaderMerging() {
    * @see \Drupal\Tests\Core\Cache\CacheContextsTest
    */
   public function testAddCacheableDependency(BubbleableMetadata $a, $b, BubbleableMetadata $expected) {
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
index 3b52f9a..14d1dea 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
@@ -6,6 +6,7 @@
 use Drupal\Core\Form\FormBuilderInterface;
 use Drupal\Core\GeneratedUrl;
 use Drupal\Core\Render\Element\RenderElement;
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -50,7 +51,7 @@ public function testPreRenderAjaxForm() {
     $request->query->set('foo', 'bar');
     $this->requestStack->push($request);
 
-    $prophecy = $this->prophesize('Drupal\Core\Routing\UrlGeneratorInterface');
+    $prophecy = $this->prophesize(UrlGeneratorInterface::class);
     $url = '/test?foo=bar&ajax_form=1';
     $prophecy->generateFromRoute('<current>', [], ['query' => ['foo' => 'bar', FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]], TRUE)
       ->willReturn((new GeneratedUrl())->setCacheContexts(['route'])->setGeneratedUrl($url));
@@ -81,7 +82,7 @@ public function testPreRenderAjaxFormWithQueryOptions() {
     $request->query->set('foo', 'bar');
     $this->requestStack->push($request);
 
-    $prophecy = $this->prophesize('Drupal\Core\Routing\UrlGeneratorInterface');
+    $prophecy = $this->prophesize(UrlGeneratorInterface::class);
     $url = '/test?foo=bar&other=query&ajax_form=1';
     $prophecy->generateFromRoute('<current>', [], ['query' => ['foo' => 'bar', 'other' => 'query', FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]], TRUE)
       ->willReturn((new GeneratedUrl())->setCacheContexts(['route'])->setGeneratedUrl($url));
diff --git a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
index c305830..101dbf5 100644
--- a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
@@ -7,8 +7,14 @@
 
 namespace Drupal\Tests\Core\Render;
 
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Render\Element\ElementInterface;
+use Drupal\Core\Render\Element\FormElementInterface;
 use Drupal\Core\Render\ElementInfoManager;
 use Drupal\Core\Theme\ActiveTheme;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -60,10 +66,10 @@ class ElementInfoManagerTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->cacheTagsInvalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
 
     $this->elementInfo = new ElementInfoManager(new \ArrayObject(), $this->cache, $this->cacheTagsInvalidator, $this->moduleHandler, $this->themeManager);
   }
@@ -89,7 +95,7 @@ public function testGetInfoElementPlugin($plugin_class, $expected_info) {
         '#theme' => 'page',
       ]);
 
-    $element_info = $this->getMockBuilder('Drupal\Core\Render\ElementInfoManager')
+    $element_info = $this->getMockBuilder(ElementInfoManager::class)
       ->setConstructorArgs([new \ArrayObject(), $this->cache, $this->cacheTagsInvalidator, $this->moduleHandler, $this->themeManager])
       ->setMethods(['getDefinitions', 'createInstance'])
       ->getMock();
@@ -119,7 +125,7 @@ public function testGetInfoElementPlugin($plugin_class, $expected_info) {
   public function providerTestGetInfoElementPlugin() {
     $data = [];
     $data[] = [
-      'Drupal\Core\Render\Element\ElementInterface',
+      ElementInterface::class,
       [
         '#type' => 'page',
         '#theme' => 'page',
@@ -128,7 +134,7 @@ public function providerTestGetInfoElementPlugin() {
     ];
 
     $data[] = [
-      'Drupal\Core\Render\Element\FormElementInterface',
+      FormElementInterface::class,
       [
         '#type' => 'page',
         '#theme' => 'page',
diff --git a/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
index 9524b0d9..3a2a47a 100644
--- a/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Render;
 
+use \Drupal\Core\Render\RendererInterface;
 use Drupal\Core\Render\MetadataBubblingUrlGenerator;
 use Drupal\Core\Url;
 use Drupal\Tests\Core\Routing\UrlGeneratorTest;
@@ -28,7 +29,7 @@ class MetadataBubblingUrlGeneratorTest extends UrlGeneratorTest {
   protected function setUp() {
     parent::setUp();
 
-    $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
     $this->renderer->expects($this->any())
       ->method('hasRenderContext')
       ->willReturn(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php b/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
index 776b794..cc55113 100644
--- a/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Render\Placeholder;
 
+use \Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface;
 use Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy;
 use Drupal\Tests\UnitTestCase;
 
@@ -43,7 +44,7 @@ public function providerProcessPlaceholders() {
       'remove-me' => ['#markup' => 'I-am-a-llama-that-will-be-removed-sad-face.'],
     ];
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn([]);
     $dev_null_strategy = $prophecy->reveal();
 
@@ -54,7 +55,7 @@ public function providerProcessPlaceholders() {
       '67890' => ['#markup' => 'special-placeholder'],
     ];
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn($placeholders);
     $single_flush_strategy = $prophecy->reveal();
 
@@ -68,18 +69,18 @@ public function providerProcessPlaceholders() {
       '12345' => ['#markup' => '<esi:include src="/fragment/12345" />'],
     ];
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn($result);
     $esi_strategy = $prophecy->reveal();
 
     $data['fake esi strategy'] = [[$esi_strategy], $placeholders, $result];
 
     // ESI + SingleFlush strategy (ESI replaces all).
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn($result);
     $esi_strategy = $prophecy->reveal();
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->shouldNotBeCalled();
     $prophecy->processPlaceholders($result)->shouldNotBeCalled();
     $prophecy->processPlaceholders([])->shouldNotBeCalled();
@@ -105,11 +106,11 @@ public function providerProcessPlaceholders() {
 
     $result = $esi_result + $normal_result;
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn($esi_result);
     $esi_strategy = $prophecy->reveal();
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($normal_result)->willReturn($normal_result);
     $single_flush_strategy = $prophecy->reveal();
 
@@ -146,7 +147,7 @@ public function testProcessPlaceholdersWithRoguePlaceholderStrategy() {
       'new-placeholder' => ['#markup' => 'rogue llama'],
     ];
 
-    $prophecy = $this->prophesize('\Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface');
+    $prophecy = $this->prophesize(PlaceholderStrategyInterface::class);
     $prophecy->processPlaceholders($placeholders)->willReturn($result);
     $rogue_strategy = $prophecy->reveal();
 
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index 00426c2..ea5a5b1 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -885,7 +885,7 @@ public function testScalarLazybuilderCallbackContext() {
     ]];
 
     $result = $this->renderer->renderRoot($element);
-    $this->assertInstanceOf('\Drupal\Core\Render\Markup', $result);
+    $this->assertInstanceOf(\Drupal\Core\Render\Markup::class, $result);
     $this->assertEquals('<p>This is a rendered placeholder!</p>', (string) $result);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
index 964898c..f181f69 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
@@ -9,11 +9,16 @@
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Cache\CacheFactoryInterface;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Cache\Context\ContextCacheKeys;
 use Drupal\Core\Cache\MemoryBackend;
+use Drupal\Core\Controller\ControllerResolverInterface;
+use Drupal\Core\Render\ElementInfoManagerInterface;
 use Drupal\Core\Render\PlaceholderGenerator;
 use Drupal\Core\Render\PlaceholderingRenderCache;
 use Drupal\Core\Render\Renderer;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\HttpFoundation\Request;
@@ -116,9 +121,9 @@
   protected function setUp() {
     parent::setUp();
 
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
-    $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
-    $this->elementInfo = $this->getMock('Drupal\Core\Render\ElementInfoManagerInterface');
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
+    $this->elementInfo = $this->getMock(ElementInfoManagerInterface::class);
     $this->elementInfo->expects($this->any())
       ->method('getInfo')
       ->willReturnCallback(function ($type) {
@@ -139,8 +144,8 @@ protected function setUp() {
     $request = new Request();
     $request->server->set('REQUEST_TIME', $_SERVER['REQUEST_TIME']);
     $this->requestStack->push($request);
-    $this->cacheFactory = $this->getMock('Drupal\Core\Cache\CacheFactoryInterface');
-    $this->cacheContextsManager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $this->cacheFactory = $this->getMock(CacheFactoryInterface::class);
+    $this->cacheContextsManager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->cacheContextsManager->method('assertValidTokens')->willReturn(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php b/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
index 1de1745..ecfea62 100644
--- a/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Render\BubbleableMetadata;
+use Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface;
 use Drupal\Core\RouteProcessor\RouteProcessorManager;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
@@ -63,7 +64,7 @@ public function testRouteProcessorManager() {
    * @return \Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function getMockProcessor($route_name, $route, $parameters) {
-    $processor = $this->getMock('Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface');
+    $processor = $this->getMock(OutboundRouteProcessorInterface::class);
     $processor->expects($this->once())
       ->method('processOutbound')
       ->with($route_name, $route, $parameters);
diff --git a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
index 53405f1..33f2688 100644
--- a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
@@ -2,9 +2,11 @@
 
 namespace Drupal\Tests\Core\Routing;
 
+use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Routing\AccessAwareRouter;
 use Drupal\Core\Routing\AccessAwareRouterInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -48,8 +50,8 @@ class AccessAwareRouterTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
     $this->route = new Route('test');
-    $this->accessManager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
-    $this->currentUser = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $this->accessManager = $this->getMock(AccessManagerInterface::class);
+    $this->currentUser = $this->getMock(AccountInterface::class);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
index 2d733c3..1f5ec6b 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Routing\RedirectDestination;
+use Drupal\Core\Routing\UrlGeneratorInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -42,7 +43,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->requestStack = new RequestStack();
-    $this->urlGenerator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
     $this->redirectDestination = new RedirectDestination($this->requestStack, $this->urlGenerator);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
index d075934..1df3104 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
@@ -7,8 +7,14 @@
 
 namespace Drupal\Tests\Core\Routing;
 
+use \Drupal\Core\Access\CheckProviderInterface;
+use \Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Drupal\Core\Controller\ControllerResolverInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Discovery\YamlDiscovery;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Routing\MatcherDumperInterface;
 use Drupal\Core\Routing\RouteBuilder;
 use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Core\Routing\RoutingEvents;
@@ -77,15 +83,15 @@ class RouteBuilderTest extends UnitTestCase {
   protected $checkProvider;
 
   protected function setUp() {
-    $this->dumper = $this->getMock('Drupal\Core\Routing\MatcherDumperInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
-    $this->dispatcher = $this->getMock('\Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->controllerResolver = $this->getMock('Drupal\Core\Controller\ControllerResolverInterface');
-    $this->yamlDiscovery = $this->getMockBuilder('\Drupal\Core\Discovery\YamlDiscovery')
+    $this->dumper = $this->getMock(MatcherDumperInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
+    $this->dispatcher = $this->getMock(EventDispatcherInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->controllerResolver = $this->getMock(ControllerResolverInterface::class);
+    $this->yamlDiscovery = $this->getMockBuilder(\Drupal\Core\Discovery\YamlDiscovery::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->checkProvider = $this->getMock('\Drupal\Core\Access\CheckProviderInterface');
+    $this->checkProvider = $this->getMock(CheckProviderInterface::class);
 
     $this->routeBuilder = new TestRouteBuilder($this->dumper, $this->lock, $this->dispatcher, $this->moduleHandler, $this->controllerResolver, $this->checkProvider);
     $this->routeBuilder->setYamlDiscovery($this->yamlDiscovery);
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
index 2ddfdca..0bce9a3 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
@@ -54,7 +54,7 @@ public function providerTestGetFit() {
    */
   public function testCompilation() {
     $route = new Route('/test/{something}/more');
-    $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
+    $route->setOption('compiler_class', RouteCompiler::class);
     $compiled = $route->compile();
 
     $this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was incorrect.');
@@ -70,7 +70,7 @@ public function testCompilationDefaultValue() {
     $route = new Route('/test/{something}/more/{here}', [
       'here' => 'there',
     ]);
-    $route->setOption('compiler_class', 'Drupal\Core\Routing\RouteCompiler');
+    $route->setOption('compiler_class', RouteCompiler::class);
     $compiled = $route->compile();
 
     $this->assertEquals($compiled->getFit(), 5 /* That's 101 binary*/, 'The fit was not correct.');
diff --git a/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php b/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
index 90b4a9d..2d29d92 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
@@ -2,6 +2,11 @@
 
 namespace Drupal\Tests\Core\Routing;
 
+use \Drupal\Core\State\StateInterface;
+use \Symfony\Component\HttpKernel\Event\KernelEvent;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Routing\PreloadableRouteProviderInterface;
+use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Core\Routing\RoutePreloader;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\EventDispatcher\Event;
@@ -47,9 +52,9 @@ class RoutePreloaderTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->routeProvider = $this->getMock('Drupal\Core\Routing\PreloadableRouteProviderInterface');
-    $this->state = $this->getMock('\Drupal\Core\State\StateInterface');
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+    $this->routeProvider = $this->getMock(PreloadableRouteProviderInterface::class);
+    $this->state = $this->getMock(StateInterface::class);
+    $this->cache = $this->getMock(CacheBackendInterface::class);
     $this->preloader = new RoutePreloader($this->routeProvider, $this->state, $this->cache);
   }
 
@@ -57,7 +62,7 @@ protected function setUp() {
    * Tests onAlterRoutes with just admin routes.
    */
   public function testOnAlterRoutesWithAdminRoutes() {
-    $event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
+    $event = $this->getMockBuilder(RouteBuildEvent::class)
       ->disableOriginalConstructor()
       ->getMock();
     $route_collection = new RouteCollection();
@@ -78,7 +83,7 @@ public function testOnAlterRoutesWithAdminRoutes() {
    * Tests onAlterRoutes with "admin" appearing in the path.
    */
   public function testOnAlterRoutesWithAdminPathNoAdminRoute() {
-    $event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
+    $event = $this->getMockBuilder(RouteBuildEvent::class)
       ->disableOriginalConstructor()
       ->getMock();
     $route_collection = new RouteCollection();
@@ -102,7 +107,7 @@ public function testOnAlterRoutesWithAdminPathNoAdminRoute() {
    * Tests onAlterRoutes with admin routes and non admin routes.
    */
   public function testOnAlterRoutesWithNonAdminRoutes() {
-    $event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
+    $event = $this->getMockBuilder(RouteBuildEvent::class)
       ->disableOriginalConstructor()
       ->getMock();
     $route_collection = new RouteCollection();
@@ -125,7 +130,7 @@ public function testOnAlterRoutesWithNonAdminRoutes() {
    * Tests onRequest on a non html request.
    */
   public function testOnRequestNonHtml() {
-    $event = $this->getMockBuilder('\Symfony\Component\HttpKernel\Event\KernelEvent')
+    $event = $this->getMockBuilder(KernelEvent::class)
       ->disableOriginalConstructor()
       ->getMock();
     $request = new Request();
@@ -146,7 +151,7 @@ public function testOnRequestNonHtml() {
    * Tests onRequest on a html request.
    */
   public function testOnRequestOnHtml() {
-    $event = $this->getMockBuilder('\Symfony\Component\HttpKernel\Event\KernelEvent')
+    $event = $this->getMockBuilder(KernelEvent::class)
       ->disableOriginalConstructor()
       ->getMock();
     $request = new Request();
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index 6c6d768..7797780 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -3,12 +3,16 @@
 namespace Drupal\Tests\Core\Routing;
 
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Path\AliasManager;
 use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
 use Drupal\Core\PathProcessor\PathProcessorAlias;
 use Drupal\Core\PathProcessor\PathProcessorManager;
 use Drupal\Core\Render\BubbleableMetadata;
+use Drupal\Core\RouteProcessor\RouteProcessorManager;
 use Drupal\Core\Routing\RequestContext;
+use Drupal\Core\Routing\RouteProvider;
 use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\Routing\UrlGenerator;
 use Drupal\Tests\UnitTestCase;
@@ -79,7 +83,7 @@ class UrlGeneratorTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
+    $cache_contexts_manager = $this->getMockBuilder(CacheContextsManager::class)
       ->disableOriginalConstructor()
       ->getMock();
     $cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
@@ -101,7 +105,7 @@ protected function setUp() {
     $routes->add('<none>', $none_route);
 
     // Create a route provider stub.
-    $provider = $this->getMockBuilder('Drupal\Core\Routing\RouteProvider')
+    $provider = $this->getMockBuilder(RouteProvider::class)
       ->disableOriginalConstructor()
       ->getMock();
     // We need to set up return value maps for both the getRouteByName() and the
@@ -143,7 +147,7 @@ protected function setUp() {
       ->will($this->returnValueMap($routes_names_return_map));
 
     // Create an alias manager stub.
-    $alias_manager = $this->getMockBuilder('Drupal\Core\Path\AliasManager')
+    $alias_manager = $this->getMockBuilder(AliasManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -165,7 +169,7 @@ protected function setUp() {
     $processor_manager->addOutbound($processor, 1000);
     $this->processorManager = $processor_manager;
 
-    $this->routeProcessorManager = $this->getMockBuilder('Drupal\Core\RouteProcessor\RouteProcessorManager')
+    $this->routeProcessorManager = $this->getMockBuilder(RouteProcessorManager::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php
index 5fa503b..a6af2e2 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Routing;
 
+use Drupal\Core\Routing\UrlGeneratorInterface;
+use Drupal\Core\Routing\UrlGeneratorTrait;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -15,9 +17,9 @@ class UrlGeneratorTraitTest extends UnitTestCase {
    * @covers ::getUrlGenerator
    */
   public function testGetUrlGenerator() {
-    $url_generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $url_generator = $this->getMock(UrlGeneratorInterface::class);
 
-    $url_generator_trait_object = $this->getMockForTrait('Drupal\Core\Routing\UrlGeneratorTrait');
+    $url_generator_trait_object = $this->getMockForTrait(UrlGeneratorTrait::class);
     $url_generator_trait_object->setUrlGenerator($url_generator);
 
     $url_generator_method = new \ReflectionMethod($url_generator_trait_object, 'getUrlGenerator');
@@ -33,13 +35,13 @@ public function testRedirect() {
     $route_name = 'some_route_name';
     $generated_url = 'some/generated/url';
 
-    $url_generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $url_generator = $this->getMock(UrlGeneratorInterface::class);
     $url_generator->expects($this->once())
       ->method('generateFromRoute')
       ->with($route_name, [], ['absolute' => TRUE])
       ->willReturn($generated_url);
 
-    $url_generator_trait_object = $this->getMockForTrait('Drupal\Core\Routing\UrlGeneratorTrait');
+    $url_generator_trait_object = $this->getMockForTrait(UrlGeneratorTrait::class);
     $url_generator_trait_object->setUrlGenerator($url_generator);
 
     $url_generator_method = new \ReflectionMethod($url_generator_trait_object, 'redirect');
diff --git a/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php b/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
index aa980f8..91aff1f 100644
--- a/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\Session;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\PrivateKey;
 use Drupal\Core\Session\PermissionsHashGenerator;
 use Drupal\Core\Site\Settings;
 use Drupal\Tests\UnitTestCase;
@@ -129,17 +131,17 @@ protected function setUp() {
 
     // Mocked private key + cache services.
     $random = Crypt::randomBytesBase64(55);
-    $this->privateKey = $this->getMockBuilder('Drupal\Core\PrivateKey')
+    $this->privateKey = $this->getMockBuilder(PrivateKey::class)
       ->disableOriginalConstructor()
       ->setMethods(['get'])
       ->getMock();
     $this->privateKey->expects($this->any())
       ->method('get')
       ->will($this->returnValue($random));
-    $this->cache = $this->getMockBuilder('Drupal\Core\Cache\CacheBackendInterface')
+    $this->cache = $this->getMockBuilder(CacheBackendInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->staticCache = $this->getMockBuilder('Drupal\Core\Cache\CacheBackendInterface')
+    $this->staticCache = $this->getMockBuilder(CacheBackendInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
index 38ee14f..621dfb6 100644
--- a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Session;
 
+use Drupal\Core\Session\SessionConfiguration;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -17,7 +18,7 @@ class SessionConfigurationTest extends UnitTestCase {
    * @returns \Drupal\Core\Session\SessionConfiguration|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function createSessionConfiguration($options = []) {
-    return $this->getMock('Drupal\Core\Session\SessionConfiguration', ['drupalValidTestUa'], [$options]);
+    return $this->getMock(SessionConfiguration::class, ['drupalValidTestUa'], [$options]);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
index 85fe1bb..837e608 100644
--- a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Session;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Session\UserSession;
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\RoleInterface;
@@ -108,7 +109,7 @@ protected function setUp() {
         [['anonymous', 'role_one', 'role_two'], [$roles['role_one'], $roles['role_two']]],
       ]));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $entity_manager = $this->getMock(EntityManagerInterface::class);
     $entity_manager->expects($this->any())
       ->method('getStorage')
       ->with($this->equalTo('user_role'))
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php
index 560675e..7fedc49 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\StringTranslation;
 
+use \Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\Core\StringTranslation\TranslationInterface;
@@ -33,7 +34,7 @@ class StringTranslationTraitTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->translation = $this->getObjectForTrait('\Drupal\Core\StringTranslation\StringTranslationTrait');
+    $this->translation = $this->getObjectForTrait(StringTranslationTrait::class);
     $mock = $this->prophesize(TranslationInterface::class);
     $mock->translate(Argument::cetera())->shouldNotBeCalled();
     $mock->formatPlural(Argument::cetera())->shouldNotBeCalled();
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
index 2cd750b..85c4cb7 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\StringTranslation;
 
+use \Drupal\Core\StringTranslation\Translator\TranslatorInterface;
 use Drupal\Component\Render\MarkupInterface;
 use Drupal\Core\StringTranslation\TranslationManager;
 use Drupal\Tests\UnitTestCase;
@@ -52,7 +53,7 @@ public function providerTestFormatPlural() {
    */
   public function testFormatPlural($count, $singular, $plural, array $args = [], array $options = [], $expected) {
     $langcode = empty($options['langcode']) ? 'fr' : $options['langcode'];
-    $translator = $this->getMock('\Drupal\Core\StringTranslation\Translator\TranslatorInterface');
+    $translator = $this->getMock(TranslatorInterface::class);
     $translator->expects($this->once())
       ->method('getStringTranslation')
       ->with($langcode, $this->anything(), $this->anything())
diff --git a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
index a872e30..ee020f6 100644
--- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
@@ -2,6 +2,12 @@
 
 namespace Drupal\Tests\Core\Template;
 
+use \Drupal\Component\Render\MarkupInterface;
+use \Drupal\Core\Datetime\DateFormatterInterface;
+use \Drupal\Core\Render\RendererInterface;
+use \Drupal\Core\Routing\UrlGeneratorInterface;
+use \Drupal\Core\Theme\ActiveTheme;
+use \Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Core\GeneratedLink;
 use Drupal\Core\Render\RenderableInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
@@ -62,10 +68,10 @@ class TwigExtensionTest extends UnitTestCase {
   public function setUp() {
     parent::setUp();
 
-    $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
-    $this->urlGenerator = $this->getMock('\Drupal\Core\Routing\UrlGeneratorInterface');
-    $this->themeManager = $this->getMock('\Drupal\Core\Theme\ThemeManagerInterface');
-    $this->dateFormatter = $this->getMock('\Drupal\Core\Datetime\DateFormatterInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
+    $this->dateFormatter = $this->getMock(DateFormatterInterface::class);
 
     $this->systemUnderTest = new TwigExtension($this->renderer, $this->urlGenerator, $this->themeManager, $this->dateFormatter);
   }
@@ -130,7 +136,7 @@ public function providerTestEscaping() {
    * @group legacy
    */
   public function testActiveTheme() {
-    $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
+    $active_theme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $active_theme->expects($this->once())
@@ -166,7 +172,7 @@ public function testFormatDate() {
    * Tests the active_theme_path function.
    */
   public function testActiveThemePath() {
-    $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
+    $active_theme = $this->getMockBuilder(ActiveTheme::class)
       ->disableOriginalConstructor()
       ->getMock();
     $active_theme
@@ -201,7 +207,7 @@ public function testSafeStringEscaping() {
 
     // By default, TwigExtension will attempt to cast objects to strings.
     // Ensure objects that implement MarkupInterface are unchanged.
-    $safe_string = $this->getMock('\Drupal\Component\Render\MarkupInterface');
+    $safe_string = $this->getMock(MarkupInterface::class);
     $this->assertSame($safe_string, $this->systemUnderTest->escapeFilter($twig, $safe_string, 'html', 'UTF-8', TRUE));
 
     // Ensure objects that do not implement MarkupInterface are escaped.
diff --git a/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php b/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
index 1bbb9f4..406b1eb 100644
--- a/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
@@ -7,6 +7,9 @@
 
 namespace Drupal\Tests\Core\Template;
 
+use Drupal\Core\Url;
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Template\Attribute;
 use Drupal\Core\Template\TwigSandboxPolicy;
 use Drupal\Core\Template\Loader\StringLoader;
@@ -48,7 +51,7 @@ protected function setUp() {
    * @dataProvider getTwigEntityDangerousMethods
    */
   public function testEntityDangerousMethods($template) {
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $this->setExpectedException(\Twig_Sandbox_SecurityError::class);
     $this->twig->render($template, ['entity' => $entity]);
   }
@@ -79,7 +82,7 @@ public function testExtendedClass() {
    * Currently "get", "has", and "is" are the only allowed prefixes.
    */
   public function testEntitySafePrefixes() {
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('hasLinkTemplate')
       ->with('test')
@@ -87,14 +90,14 @@ public function testEntitySafePrefixes() {
     $result = $this->twig->render('{{ entity.hasLinkTemplate("test") }}', ['entity' => $entity]);
     $this->assertTrue((bool)$result, 'Sandbox policy allows has* functions to be called.');
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('isNew')
       ->willReturn(TRUE);
     $result = $this->twig->render('{{ entity.isNew }}', ['entity' => $entity]);
     $this->assertTrue((bool)$result, 'Sandbox policy allows is* functions to be called.');
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('getEntityType')
       ->willReturn('test');
@@ -109,7 +112,7 @@ public function testEntitySafePrefixes() {
    * get.
    */
   public function testEntitySafeMethods() {
-    $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
+    $entity = $this->getMockBuilder(ContentEntityBase::class)
       ->disableOriginalConstructor()
       ->getMock();
     $entity->expects($this->atLeastOnce())
@@ -119,21 +122,21 @@ public function testEntitySafeMethods() {
     $result = $this->twig->render('{{ entity.get("title") }}', ['entity' => $entity]);
     $this->assertEquals($result, 'test', 'Sandbox policy allows get() to be called.');
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('id')
       ->willReturn('1234');
     $result = $this->twig->render('{{ entity.id }}', ['entity' => $entity]);
     $this->assertEquals($result, '1234', 'Sandbox policy allows get() to be called.');
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('label')
       ->willReturn('testing');
     $result = $this->twig->render('{{ entity.label }}', ['entity' => $entity]);
     $this->assertEquals($result, 'testing', 'Sandbox policy allows get() to be called.');
 
-    $entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
+    $entity = $this->getMock(EntityInterface::class);
     $entity->expects($this->atLeastOnce())
       ->method('bundle')
       ->willReturn('testing');
@@ -145,7 +148,7 @@ public function testEntitySafeMethods() {
    * Tests that safe methods inside Url objects can be called.
    */
   public function testUrlSafeMethods() {
-    $url = $this->getMockBuilder('Drupal\Core\Url')
+    $url = $this->getMockBuilder(Url::class)
       ->disableOriginalConstructor()
       ->getMock();
     $url->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
index f2cd22e..f6797b0 100644
--- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
@@ -7,8 +7,14 @@
 
 namespace Drupal\Tests\Core\Theme;
 
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Extension\ThemeHandlerInterface;
+use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\Theme\ActiveTheme;
 use Drupal\Core\Theme\Registry;
+use Drupal\Core\Theme\ThemeInitializationInterface;
+use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -79,12 +85,12 @@ class RegistryTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
-    $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface');
-    $this->themeInitialization = $this->getMock('Drupal\Core\Theme\ThemeInitializationInterface');
-    $this->themeManager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
+    $this->lock = $this->getMock(LockBackendInterface::class);
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->themeHandler = $this->getMock(ThemeHandlerInterface::class);
+    $this->themeInitialization = $this->getMock(ThemeInitializationInterface::class);
+    $this->themeManager = $this->getMock(ThemeManagerInterface::class);
 
     $this->setupTheme();
   }
diff --git a/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php b/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
index 1e2303d..1496cc0 100644
--- a/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
@@ -2,10 +2,12 @@
 
 namespace Drupal\Tests\Core\Theme;
 
+use \Drupal\Core\Theme\ThemeAccessCheck;
 use Drupal\Core\DependencyInjection\ClassResolver;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Routing\RouteMatch;
 use Drupal\Core\Theme\ThemeNegotiator;
+use Drupal\Core\Theme\ThemeNegotiatorInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Routing\Route;
 
@@ -47,7 +49,7 @@ class ThemeNegotiatorTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->themeAccessCheck = $this->getMockBuilder('\Drupal\Core\Theme\ThemeAccessCheck')
+    $this->themeAccessCheck = $this->getMockBuilder(ThemeAccessCheck::class)
       ->disableOriginalConstructor()
       ->getMock();
     $this->container = new ContainerBuilder();
@@ -59,7 +61,7 @@ protected function setUp() {
    * @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
    */
   public function testDetermineActiveTheme() {
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->once())
       ->method('determineActiveTheme')
       ->will($this->returnValue('example_test'));
@@ -89,7 +91,7 @@ public function testDetermineActiveTheme() {
   public function testDetermineActiveThemeWithPriority() {
     $negotiators = [];
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->once())
       ->method('determineActiveTheme')
       ->will($this->returnValue('example_test'));
@@ -99,7 +101,7 @@ public function testDetermineActiveThemeWithPriority() {
 
     $negotiators['test_negotiator_1'] = $negotiator;
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->never())
       ->method('determineActiveTheme');
     $negotiator->expects($this->never())
@@ -129,7 +131,7 @@ public function testDetermineActiveThemeWithPriority() {
   public function testDetermineActiveThemeWithAccessCheck() {
     $negotiators = [];
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->once())
       ->method('determineActiveTheme')
       ->will($this->returnValue('example_test'));
@@ -139,7 +141,7 @@ public function testDetermineActiveThemeWithAccessCheck() {
 
     $negotiators['test_negotiator_1'] = $negotiator;
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->once())
       ->method('determineActiveTheme')
       ->will($this->returnValue('example_test2'));
@@ -177,7 +179,7 @@ public function testDetermineActiveThemeWithAccessCheck() {
   public function testDetermineActiveThemeWithNotApplyingNegotiator() {
     $negotiators = [];
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->never())
       ->method('determineActiveTheme');
     $negotiator->expects($this->once())
@@ -186,7 +188,7 @@ public function testDetermineActiveThemeWithNotApplyingNegotiator() {
 
     $negotiators['test_negotiator_1'] = $negotiator;
 
-    $negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $negotiator = $this->getMock(ThemeNegotiatorInterface::class);
     $negotiator->expects($this->once())
       ->method('determineActiveTheme')
       ->will($this->returnValue('example_test2'));
diff --git a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
index ac19ffa..95f39d8 100644
--- a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
+++ b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Transliteration;
 
 use Drupal\Component\Utility\Random;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Transliteration\PhpTransliteration;
 use Drupal\Tests\UnitTestCase;
 
@@ -37,7 +38,7 @@ public function testPhpTransliterationWithAlter($langcode, $original, $expected,
 
     // Test each case both with a new instance of the transliteration class,
     // and with one that builds as it goes.
-    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler = $this->getMock(ModuleHandlerInterface::class);
     $module_handler->expects($this->any())
       ->method('alter')
       ->will($this->returnCallback(function($hook, &$overrides, $langcode) {
diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
index 08b8117..43bc760 100644
--- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
@@ -8,13 +8,17 @@
 namespace Drupal\Tests\Core\TypedData;
 
 use Drupal\Core\Cache\NullBackend;
+use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\MapDataDefinition;
+use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\Core\TypedData\TypedDataManager;
 use Drupal\Core\TypedData\Validation\ExecutionContextFactory;
 use Drupal\Core\TypedData\Validation\RecursiveValidator;
 use Drupal\Core\Validation\ConstraintManager;
+use Drupal\Core\Validation\TranslatorInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\Validator\ConstraintValidatorFactory;
 use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -64,10 +68,10 @@ protected function setUp() {
       'Drupal\\Core\\TypedData' => $this->root . '/core/lib/Drupal/Core/TypedData',
       'Drupal\\Core\\Validation' => $this->root . '/core/lib/Drupal/Core/Validation',
     ]);
-    $module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface')
+    $module_handler = $this->getMockBuilder(ModuleHandlerInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $class_resolver = $this->getMockBuilder('Drupal\Core\DependencyInjection\ClassResolverInterface')
+    $class_resolver = $this->getMockBuilder(ClassResolverInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
@@ -80,7 +84,7 @@ protected function setUp() {
     $container->set('typed_data_manager', $this->typedDataManager);
     \Drupal::setContainer($container);
 
-    $translator = $this->getMock('Drupal\Core\Validation\TranslatorInterface');
+    $translator = $this->getMock(TranslatorInterface::class);
     $translator->expects($this->any())
       ->method('trans')
       ->willReturnCallback(function($id) {
@@ -258,7 +262,7 @@ public function providerTestValidatePropertyWithInvalidObjects() {
     $data[] = [new \stdClass()];
     $data[] = [new TestClass()];
 
-    $data[] = [$this->getMock('Drupal\Core\TypedData\TypedDataInterface')];
+    $data[] = [$this->getMock(TypedDataInterface::class)];
 
     return $data;
   }
diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
index 680e2fd..e9439af 100644
--- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Url;
+use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
@@ -48,7 +49,7 @@ class UnroutedUrlTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->urlAssembler = $this->getMock('Drupal\Core\Utility\UnroutedUrlAssemblerInterface');
+    $this->urlAssembler = $this->getMock(UnroutedUrlAssemblerInterface::class);
     $this->urlAssembler->expects($this->any())
       ->method('assemble')
       ->will($this->returnArgument(0));
@@ -70,7 +71,7 @@ protected function setUp() {
   public function testFromUri($uri, $is_external) {
     $url = Url::fromUri($uri);
 
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
   }
 
 
diff --git a/core/tests/Drupal/Tests/Core/UrlTest.php b/core/tests/Drupal/Tests/Core/UrlTest.php
index ff4cb01..eaed78a 100644
--- a/core/tests/Drupal/Tests/Core/UrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UrlTest.php
@@ -7,11 +7,16 @@
 
 namespace Drupal\Tests\Core;
 
+use \Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\GeneratedUrl;
+use Drupal\Core\Path\AliasManagerInterface;
+use Drupal\Core\Path\PathValidatorInterface;
 use Drupal\Core\Routing\RouteMatch;
+use Drupal\Core\Routing\UrlGeneratorInterface;
+use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Url;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -96,18 +101,18 @@ protected function setUp() {
       $generate_from_route_map[] = $values;
       $generate_from_route_map[] = [$values[0], $values[1], $values[2], TRUE, (new GeneratedUrl())->setGeneratedUrl($values[4])];
     }
-    $this->urlGenerator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+    $this->urlGenerator = $this->getMock(UrlGeneratorInterface::class);
     $this->urlGenerator->expects($this->any())
       ->method('generateFromRoute')
       ->will($this->returnValueMap($generate_from_route_map));
 
-    $this->pathAliasManager = $this->getMock('Drupal\Core\Path\AliasManagerInterface');
+    $this->pathAliasManager = $this->getMock(AliasManagerInterface::class);
     $this->pathAliasManager->expects($this->any())
       ->method('getPathByAlias')
       ->will($this->returnValueMap($alias_map));
 
     $this->router = $this->getMock('Drupal\Tests\Core\Routing\TestRouterInterface');
-    $this->pathValidator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $this->pathValidator = $this->getMock(PathValidatorInterface::class);
 
     $this->container = new ContainerBuilder();
     $this->container->set('router.no_access_checks', $this->router);
@@ -189,7 +194,7 @@ public function testFromUserInput($path) {
     $url = Url::fromUserInput($path);
     $uri = $url->getUri();
 
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
     $this->assertFalse($url->isRouted());
     $this->assertEquals(0, strpos($uri, 'base:'));
 
@@ -365,7 +370,7 @@ public function testGetInternalPath($urls) {
       // Clone the url so that there is no leak of internal state into the
       // other ones.
       $url = clone $url;
-      $url_generator = $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface');
+      $url_generator = $this->getMock(UrlGeneratorInterface::class);
       $url_generator->expects($this->once())
         ->method('getPathFromRoute')
         ->will($this->returnValueMap($map, $index));
@@ -392,7 +397,7 @@ public function testToString($urls) {
       $this->assertSame($path, $url->toString());
       $generated_url = $url->toString(TRUE);
       $this->assertSame($path, $generated_url->getGeneratedUrl());
-      $this->assertInstanceOf('\Drupal\Core\Render\BubbleableMetadata', $generated_url);
+      $this->assertInstanceOf(BubbleableMetadata::class, $generated_url);
     }
   }
 
@@ -501,7 +506,7 @@ public function testMergeOptions() {
    * @dataProvider accessProvider
    */
   public function testAccessRouted($access) {
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $url = new TestUrl('entity.node.canonical', ['node' => 3]);
     $url->setAccessManager($this->getMockAccessManager($access, $account));
     $this->assertEquals($access, $url->access($account));
@@ -513,9 +518,9 @@ public function testAccessRouted($access) {
    * @covers ::access
    */
   public function testAccessUnrouted() {
-    $account = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $account = $this->getMock(AccountInterface::class);
     $url = TestUrl::fromUri('base:kittens');
-    $access_manager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
+    $access_manager = $this->getMock(AccessManagerInterface::class);
     $access_manager->expects($this->never())
       ->method('checkNamedRoute');
     $url->setAccessManager($access_manager);
@@ -534,7 +539,7 @@ public function testRenderAccess($access) {
     $element = [
       '#url' => Url::fromRoute('entity.node.canonical', ['node' => 3]),
     ];
-    $this->container->set('current_user', $this->getMock('Drupal\Core\Session\AccountInterface'));
+    $this->container->set('current_user', $this->getMock(AccountInterface::class));
     $this->container->set('access_manager', $this->getMockAccessManager($access));
     $this->assertEquals($access, TestUrl::renderAccess($element));
   }
@@ -716,7 +721,7 @@ public function providerTestToUriStringForInternal() {
    */
   public function testFromValidInternalUri($path) {
     $url = Url::fromUri('internal:' . $path);
-    $this->assertInstanceOf('Drupal\Core\Url', $url);
+    $this->assertInstanceOf(Url::class, $url);
   }
 
   /**
@@ -840,7 +845,7 @@ public function testFromRouteUriWithMissingRouteName() {
    * @return \Drupal\Core\Access\AccessManagerInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function getMockAccessManager($access, $account = NULL) {
-    $access_manager = $this->getMock('Drupal\Core\Access\AccessManagerInterface');
+    $access_manager = $this->getMock(AccessManagerInterface::class);
     $access_manager->expects($this->once())
       ->method('checkNamedRoute')
       ->with('entity.node.canonical', ['node' => 3], $account)
diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
index 50795b3..ee858fb 100644
--- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\Core\Utility;
 
+use \Drupal\Core\Render\BubbleableMetadata;
+use \Drupal\Core\Render\RendererInterface;
+use \Drupal\Core\Routing\UrlGenerator;
+use \Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
 use Drupal\Component\Render\MarkupInterface;
 use Drupal\Core\GeneratedNoLink;
 use Drupal\Core\GeneratedUrl;
@@ -12,6 +16,8 @@
 use Drupal\Core\Utility\LinkGenerator;
 use Drupal\Tests\UnitTestCase;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Path\PathValidatorInterface;
 
 /**
  * @coversDefaultClass \Drupal\Core\Utility\LinkGenerator
@@ -70,13 +76,13 @@ class LinkGeneratorTest extends UnitTestCase {
   protected function setUp() {
     parent::setUp();
 
-    $this->urlGenerator = $this->getMockBuilder('\Drupal\Core\Routing\UrlGenerator')
+    $this->urlGenerator = $this->getMockBuilder(UrlGenerator::class)
       ->disableOriginalConstructor()
       ->getMock();
-    $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
-    $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
+    $this->renderer = $this->getMock(RendererInterface::class);
     $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->moduleHandler, $this->renderer);
-    $this->urlAssembler = $this->getMock('\Drupal\Core\Utility\UnroutedUrlAssemblerInterface');
+    $this->urlAssembler = $this->getMock(UnroutedUrlAssemblerInterface::class);
   }
 
   /**
@@ -217,7 +223,7 @@ public function testGenerateUrlWithQuotes() {
       ->with('base:example', ['query' => ['foo' => '"bar"', 'zoo' => 'baz']] + $this->defaultOptions)
       ->willReturn((new GeneratedUrl())->setGeneratedUrl('/example?foo=%22bar%22&zoo=baz'));
 
-    $path_validator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');
+    $path_validator = $this->getMock(PathValidatorInterface::class);
     $container_builder = new ContainerBuilder();
     $container_builder->set('path.validator', $path_validator);
     \Drupal::setContainer($container_builder);
@@ -500,14 +506,14 @@ public function testGenerateBubbleableMetadata() {
     $this->assertSame($expected_link_markup, (string) $this->linkGenerator->generate('Test', $url));
     $generated_link = $this->linkGenerator->generate('Test', $url);
     $this->assertSame($expected_link_markup, (string) $generated_link->getGeneratedLink());
-    $this->assertInstanceOf('\Drupal\Core\Render\BubbleableMetadata', $generated_link);
+    $this->assertInstanceOf(BubbleableMetadata::class, $generated_link);
 
     // Test ::generateFromLink().
     $link = new Link('Test', $url);
     $this->assertSame($expected_link_markup, (string) $this->linkGenerator->generateFromLink($link));
     $generated_link = $this->linkGenerator->generateFromLink($link);
     $this->assertSame($expected_link_markup, (string) $generated_link->getGeneratedLink());
-    $this->assertInstanceOf('\Drupal\Core\Render\BubbleableMetadata', $generated_link);
+    $this->assertInstanceOf(BubbleableMetadata::class, $generated_link);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
index 91620e6..95d9ef7 100644
--- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
@@ -2,12 +2,17 @@
 
 namespace Drupal\Tests\Core\Utility;
 
+use \Drupal\Core\Cache\CacheBackendInterface;
+use \Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use \Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Core\Render\Markup;
+use Drupal\Core\Render\RendererInterface;
 use Drupal\Core\Utility\Token;
 use Drupal\Tests\UnitTestCase;
 
@@ -77,17 +82,17 @@ class TokenTest extends UnitTestCase {
    * {@inheritdoc}
    */
   protected function setUp() {
-    $this->cache = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
+    $this->cache = $this->getMock(CacheBackendInterface::class);
 
-    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->languageManager = $this->getMock(LanguageManagerInterface::class);
 
-    $this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');
+    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
 
-    $this->language = $this->getMock('\Drupal\Core\Language\LanguageInterface');
+    $this->language = $this->getMock(\Drupal\Core\Language\LanguageInterface::class);
 
-    $this->cacheTagsInvalidator = $this->getMock('\Drupal\Core\Cache\CacheTagsInvalidatorInterface');
+    $this->cacheTagsInvalidator = $this->getMock(CacheTagsInvalidatorInterface::class);
 
-    $this->renderer = $this->getMock('Drupal\Core\Render\RendererInterface');
+    $this->renderer = $this->getMock(RendererInterface::class);
 
     $this->token = new Token($this->moduleHandler, $this->cache, $this->languageManager, $this->cacheTagsInvalidator, $this->renderer);
 
diff --git a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
index 01b16ad..00de8ab 100644
--- a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\Core\Utility;
 
 use Drupal\Core\GeneratedUrl;
+use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
 use Drupal\Core\Render\BubbleableMetadata;
 use Drupal\Core\Utility\UnroutedUrlAssembler;
 use Drupal\Tests\UnitTestCase;
@@ -50,7 +51,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->requestStack = new RequestStack();
-    $this->pathProcessor = $this->getMock('Drupal\Core\PathProcessor\OutboundPathProcessorInterface');
+    $this->pathProcessor = $this->getMock(OutboundPathProcessorInterface::class);
     $this->unroutedUrlAssembler = new UnroutedUrlAssembler($this->requestStack, $this->pathProcessor);
   }
 
@@ -81,7 +82,7 @@ public function testAssembleWithExternalUrl($uri, array $options, $expected) {
     $this->assertEquals($expected, $this->unroutedUrlAssembler->assemble($uri, $options));
     $generated_url = $this->unroutedUrlAssembler->assemble($uri, $options, TRUE);
     $this->assertEquals($expected, $generated_url->getGeneratedUrl());
-    $this->assertInstanceOf('\Drupal\Core\Render\BubbleableMetadata', $generated_url);
+    $this->assertInstanceOf(\Drupal\Core\Render\BubbleableMetadata::class, $generated_url);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/UnitTestCase.php b/core/tests/Drupal/Tests/UnitTestCase.php
index 8aaeb85..3169603 100644
--- a/core/tests/Drupal/Tests/UnitTestCase.php
+++ b/core/tests/Drupal/Tests/UnitTestCase.php
@@ -4,10 +4,18 @@
 
 use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Utility\Random;
+use Drupal\Core\Block\BlockBase;
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\ImmutableConfig;
+use Drupal\Core\Config\NullStorage;
+use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use PHPUnit\Framework\TestCase;
 
 
@@ -118,7 +126,7 @@ public function getConfigFactoryStub(array $configs = []) {
       // Also allow to pass in no argument.
       $map[] = ['', $config_values];
 
-      $immutable_config_object = $this->getMockBuilder('Drupal\Core\Config\ImmutableConfig')
+      $immutable_config_object = $this->getMockBuilder(ImmutableConfig::class)
         ->disableOriginalConstructor()
         ->getMock();
       $immutable_config_object->expects($this->any())
@@ -126,7 +134,7 @@ public function getConfigFactoryStub(array $configs = []) {
         ->will($this->returnValueMap($map));
       $config_get_map[] = [$config_name, $immutable_config_object];
 
-      $mutable_config_object = $this->getMockBuilder('Drupal\Core\Config\Config')
+      $mutable_config_object = $this->getMockBuilder(Config::class)
         ->disableOriginalConstructor()
         ->getMock();
       $mutable_config_object->expects($this->any())
@@ -136,7 +144,7 @@ public function getConfigFactoryStub(array $configs = []) {
     }
     // Construct a config factory with the array of configuration object stubs
     // as its return map.
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
+    $config_factory = $this->getMock(ConfigFactoryInterface::class);
     $config_factory->expects($this->any())
       ->method('get')
       ->will($this->returnValueMap($config_get_map));
@@ -158,7 +166,7 @@ public function getConfigFactoryStub(array $configs = []) {
    *   A mocked config storage.
    */
   public function getConfigStorageStub(array $configs) {
-    $config_storage = $this->getMock('Drupal\Core\Config\NullStorage');
+    $config_storage = $this->getMock(NullStorage::class);
     $config_storage->expects($this->any())
       ->method('listAll')
       ->will($this->returnValue(array_keys($configs)));
@@ -182,7 +190,7 @@ public function getConfigStorageStub(array $configs) {
    *   The mocked block.
    */
   protected function getBlockMockWithMachineName($machine_name) {
-    $plugin = $this->getMockBuilder('Drupal\Core\Block\BlockBase')
+    $plugin = $this->getMockBuilder(BlockBase::class)
       ->disableOriginalConstructor()
       ->getMock();
     $plugin->expects($this->any())
@@ -205,7 +213,7 @@ protected function getBlockMockWithMachineName($machine_name) {
    *   A mock translation object.
    */
   public function getStringTranslationStub() {
-    $translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
+    $translation = $this->getMock(TranslationInterface::class);
     $translation->expects($this->any())
       ->method('translate')
       ->willReturnCallback(function ($string, array $args = [], array $options = []) use ($translation) {
@@ -252,11 +260,11 @@ protected function getContainerWithCacheTagsInvalidator(CacheTagsInvalidatorInte
    *   The class resolver stub.
    */
   protected function getClassResolverStub() {
-    $class_resolver = $this->getMock('Drupal\Core\DependencyInjection\ClassResolverInterface');
+    $class_resolver = $this->getMock(ClassResolverInterface::class);
     $class_resolver->expects($this->any())
       ->method('getInstanceFromDefinition')
       ->will($this->returnCallback(function ($class) {
-        if (is_subclass_of($class, 'Drupal\Core\DependencyInjection\ContainerInjectionInterface')) {
+        if (is_subclass_of($class, ContainerInjectionInterface::class)) {
           return $class::create(new ContainerBuilder());
         }
         else {
