diff --git a/autoload.info b/autoload.info
index 9a7af79..3e2f556 100644
--- a/autoload.info
+++ b/autoload.info
@@ -4,3 +4,7 @@ core = 7.x
 php = 5.3
 
 files[] = tests/autoload.test
+
+; For "autoload_test_entity".
+test_dependencies[] = entity
+test_dependencies[] = views
diff --git a/autoload.install b/autoload.install
index 30d7381..3ea72fa 100644
--- a/autoload.install
+++ b/autoload.install
@@ -9,6 +9,5 @@
  * Implements hook_modules_enabled().
  */
 function autoload_modules_enabled() {
-  drupal_static_reset('autoload_paths');
-  $_SESSION['autoload_paths'] = autoload_paths();
+  autoload_reset();
 }
diff --git a/autoload.module b/autoload.module
index 8ef3192..040502d 100644
--- a/autoload.module
+++ b/autoload.module
@@ -46,6 +46,14 @@ spl_autoload_register(function ($namespace) use ($autoload) {
 });
 
 /**
+ * Reset computed autoload paths to recompute them.
+ */
+function autoload_reset() {
+  drupal_static_reset('autoload_paths');
+  $_SESSION['autoload_paths'] = autoload_paths();
+}
+
+/**
  * Collect autoloading maps.
  *
  * @return array[]
diff --git a/src/Tests/Unit/EntityTest.php b/src/Tests/Unit/EntityTest.php
new file mode 100644
index 0000000..ec7482e
--- /dev/null
+++ b/src/Tests/Unit/EntityTest.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Drupal\autoload\Tests\Unit;
+
+/**
+ * Class EntityTest.
+ */
+class EntityTest extends AuxiliaryTest {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = array('autoload_test_entity_ui');
+
+  /**
+   * {@inheritdoc}
+   */
+  public function test() {
+    // The next error must not appear:
+    // Error: Class 'Drupal\autoload_test_entity_ui\ViewsController' not found
+    // in entity_views_data() (line 31 of sites/all/modules/entity/views/entity.
+    // views.inc).
+  }
+
+}
diff --git a/tests/autoload_test_entity/autoload_test_entity.info b/tests/autoload_test_entity/autoload_test_entity.info
new file mode 100644
index 0000000..18e548b
--- /dev/null
+++ b/tests/autoload_test_entity/autoload_test_entity.info
@@ -0,0 +1,9 @@
+name = Autoload Entity Test
+description = Ensure that autoloading will work for controllers, provided by "entity" module.
+hidden = TRUE
+core = 7.x
+
+autoload = TRUE
+
+dependencies[] = autoload
+dependencies[] = entity
diff --git a/tests/autoload_test_entity/autoload_test_entity.install b/tests/autoload_test_entity/autoload_test_entity.install
new file mode 100644
index 0000000..348337a
--- /dev/null
+++ b/tests/autoload_test_entity/autoload_test_entity.install
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * Module installation and updates.
+ */
+
+/**
+ * Implements hook_schema().
+ */
+function autoload_test_entity_schema() {
+  $schema = [];
+
+  $schema['autoload_test_entity'] = [
+    'description' => 'Autoload Test Entity',
+    'fields' => [
+      'id' => [
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => 'The primary identifier.',
+      ],
+    ],
+    'primary key' => ['id'],
+  ];
+
+  return $schema;
+}
diff --git a/tests/autoload_test_entity/autoload_test_entity.module b/tests/autoload_test_entity/autoload_test_entity.module
new file mode 100644
index 0000000..e220f2f
--- /dev/null
+++ b/tests/autoload_test_entity/autoload_test_entity.module
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @file
+ * Autoload Entity Test.
+ */
+
+/**
+ * Implements hook_entity_info_alter().
+ */
+function autoload_test_entity_entity_info() {
+  $info = [];
+
+  $info['autoload_test_entity'] = [
+    'label' => t('Autoload Test Entity'),
+    'base table' => 'autoload_test_entity',
+    'controller class' => 'EntityAPIController',
+    'entity keys' => ['id' => 'id'],
+  ];
+
+  return $info;
+}
diff --git a/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.info b/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.info
new file mode 100644
index 0000000..ea8d294
--- /dev/null
+++ b/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.info
@@ -0,0 +1,8 @@
+name = Autoload Entity Test UI
+hidden = TRUE
+core = 7.x
+
+autoload = TRUE
+
+dependencies[] = autoload_test_entity
+dependencies[] = views
diff --git a/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.module b/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.module
new file mode 100644
index 0000000..fd40e12
--- /dev/null
+++ b/tests/autoload_test_entity/modules/autoload_test_entity_ui/autoload_test_entity_ui.module
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * Autoload Entity Test UI.
+ */
+
+/**
+ * Implements hook_entity_info_alter().
+ */
+function autoload_test_entity_ui_entity_info_alter(array &$entity_info) {
+  $entity_info['autoload_test_entity']['views controller class'] = 'Drupal\autoload_test_entity_ui\ViewsController';
+}
diff --git a/tests/autoload_test_entity/modules/autoload_test_entity_ui/src/ViewsController.php b/tests/autoload_test_entity/modules/autoload_test_entity_ui/src/ViewsController.php
new file mode 100644
index 0000000..3072e89
--- /dev/null
+++ b/tests/autoload_test_entity/modules/autoload_test_entity_ui/src/ViewsController.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Drupal\autoload_test_entity_ui;
+
+/**
+ * Test controller for checking its ability to be autoloaded.
+ */
+class ViewsController extends \EntityDefaultViewsController {
+
+}
