diff --git a/core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php b/core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php
new file mode 100644
index 0000000..def9c86
--- /dev/null
+++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalCheckIncompatibilityTest.php
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\KernelTests\Core\Common\DrupalCheckIncompatibilityTest.
+ */
+
+namespace Drupal\KernelTests\Core\Common;
+
+use Drupal\Core\Extension\ModuleHandler;
+use Drupal\KernelTests\KernelTestBase;
+
+/**
+ * @covers ::drupal_check_incompatibility
+ * @group Common
+ */
+class DrupalCheckIncompatibilityTest extends KernelTestBase {
+
+  /**
+   * The basic functionality of drupal_check_incompatibility().
+   *
+   * @dataProvider DrupalCheckIncompatibilityProvider
+   */
+  public function testDrupalCheckIncompatibility($dependency, $module_version, $expected) {
+    $dependency = ModuleHandler::parseDependency($dependency);
+    // If the module version starts with 8.x- is it stripped prior to using
+    // drupal_check_incompatibility(). Usual the 8.x part is obtained from
+    // \Drupal::CORE_COMPATIBILITY but we are not testing that here so it is
+    // hard coded.
+    // @see system_requirements()
+    // @see \Drupal\system\Form\ModulesListForm::buildRow()
+    $core_compatibility = '8.x';
+    $module_version = str_replace($core_compatibility . '-', '', $module_version);
+    $this->assertSame($expected, drupal_check_incompatibility($dependency, $module_version));
+  }
+
+  /**
+   * Data provider for self::testDrupalCheckIncompatibility().
+   */
+  public function DrupalCheckIncompatibilityProvider() {
+    // A NULL expected return value indicates that the dependency has been met
+    // and module is compatible.
+    return [
+      ['drupal_migrate_ui(>=8.x-0.x-alpha1)', '8.x-0.x-alpha1', NULL],
+      ['drupal_migrate_ui(<8.x-0.x-alpha1)', '8.x-0.x-alpha1', ' (<8.x-0.x-alpha1)'],
+      ['drupal_migrate_ui(>8.x-0.x-alpha1)', '8.x-0.x-alpha2', NULL],
+      ['drupal_migrate_ui(>8.x-0.x-alpha2)', '8.x-0.x-beta1', NULL],
+      ['drupal_migrate_ui(>=8.1.x)', '8.x-0.x-beta1', ' (>=8.1.x)'],
+      // Check that dependencies still work after an experimental module has
+      // become part of core and therefore gets core's version number.
+      ['drupal_migrate_ui(>8.x-0.x-alpha1)', '8.1.x-dev', NULL],
+      ['drupal_migrate_ui(<8.x-0.x-alpha1)', '8.1.x-dev', ' (<8.x-0.x-alpha1)'],
+      // A very odd test to show how fragile the current dependency checking is.
+      // This will pass but in reality this will never happen because a module's
+      // core dependency would be checked before this.
+      ['drupal_migrate_ui(>8.x-0.x-alpha1)', '3.1.x-dev', NULL],
+    ];
+  }
+
+}
