diff --git a/src/Tests/MigrateUpgradeTestBase.php b/src/Tests/MigrateUpgradeTestBase.php
new file mode 100644
index 0000000..c800687
--- /dev/null
+++ b/src/Tests/MigrateUpgradeTestBase.php
@@ -0,0 +1,186 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_upgrade\Tests\MigrateUpgradeTestBase.
+ */
+
+namespace Drupal\migrate_upgrade\Tests;
+
+use Drupal\Core\Database\Database;
+use Drupal\simpletest\WebTestBase;
+
+
+/**
+ * Base class for Drupal migration tests.
+ */
+abstract class MigrateUpgradeTestBase extends WebTestBase {
+
+  /**
+   * Exempt from strict schema checking.
+   *
+   * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
+   *
+   * @var bool
+   */
+  protected $strictConfigSchema = FALSE;
+
+  /**
+   * User with admin rights.
+   */
+  protected $privilegedUser;
+
+  /**
+   * Use the Standard profile to test help implementations of many core modules.
+   */
+  protected $profile = 'standard';
+
+  /**
+   * The primary migration being tested.
+   *
+   * @var \Drupal\migrate\Entity\MigrationInterface
+   */
+  protected $migration;
+
+  /**
+   * The source database connection.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $sourceDatabase;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('system', 'user', 'field', 'migrate_drupal', 'options', 'file', 'migrate', 'migrate_upgrade');
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->createMigrationConnection();
+    $this->sourceDatabase = Database::getConnection('default', 'migrate_upgrade');
+
+    // Create and log in our privileged user.
+    // Migrating replaces this user and they don't have permissions :)
+//    $this->privilegedUser = $this->drupalCreateUser([
+//      'access content',
+//      'administer site configuration',
+//      'administer software updates',
+//    ]);
+
+    $this->drupalLogin($this->rootUser);
+  }
+
+  /**
+   * Loads a database fixture into the source database connection.
+   *
+   * @param string $path
+   *   Path to the dump file.
+   */
+  protected function loadFixture($path) {
+    $default_db = Database::getConnection()->getKey();
+    Database::setActiveConnection($this->sourceDatabase->getKey());
+
+    if (substr($path, -3) == '.gz') {
+      $path = 'compress.zlib://' . $path;
+    }
+    require $path;
+
+    Database::setActiveConnection($default_db);
+  }
+
+  /**
+   * Changes the database connection to the prefixed one.
+   *
+   * @todo Remove when we don't use global. https://www.drupal.org/node/2552791
+   */
+  private function createMigrationConnection() {
+    // If the backup already exists, something went terribly wrong.
+    // This case is possible, because database connection info is a static
+    // global state construct on the Database class, which at least persists
+    // for all test methods executed in one PHP process.
+    if (Database::getConnectionInfo('simpletest_original_migrate')) {
+      throw new \RuntimeException("Bad Database connection state: 'simpletest_original_migrate' connection key already exists. Broken test?");
+    }
+
+    // Clone the current connection and replace the current prefix.
+    $connection_info = Database::getConnectionInfo('migrate_upgrade');
+    if ($connection_info) {
+      Database::renameConnection('migrate_upgrade', 'simpletest_original_migrate');
+    }
+    $connection_info = Database::getConnectionInfo('default');
+    foreach ($connection_info as $target => $value) {
+      $prefix = is_array($value['prefix']) ? $value['prefix']['default'] : $value['prefix'];
+      // Simpletest uses 7 character prefixes at most so this can't cause
+      // collisions.
+      $connection_info[$target]['prefix']['default'] = $prefix . '0';
+
+      // Add the original simpletest prefix so SQLite can attach its database.
+      // @see \Drupal\Core\Database\Driver\sqlite\Connection::init()
+      $connection_info[$target]['prefix'][$value['prefix']['default']] = $value['prefix']['default'];
+    }
+    Database::addConnectionInfo('migrate_upgrade', 'default', $connection_info['default']);
+    $database = Database::getConnectionInfo('migrate_upgrade');
+    $database_state['key'] = 'migrate_upgrade';
+    $database_state['database'] = $database;
+    $database_state_key = 'migrate_upgrade';
+    \Drupal::state()->set($database_state_key, $database_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function tearDown() {
+    $this->cleanupMigrateConnection();
+    parent::tearDown();
+    $this->databaseDumpFiles = [];
+    $this->collectMessages = FALSE;
+    unset($this->migration, $this->migrateMessages);
+  }
+
+  /**
+   * Cleans up the test migrate connection.
+   *
+   * @todo Remove when we don't use global. https://www.drupal.org/node/2552791
+   */
+  private function cleanupMigrateConnection() {
+    Database::removeConnection('migrate');
+    $original_connection_info = Database::getConnectionInfo('simpletest_original_migrate');
+    if ($original_connection_info) {
+      Database::renameConnection('simpletest_original_migrate', 'migrate_upgrade');
+    }
+  }
+
+  /**
+   * Executes all steps of migrations upgrade.
+   *
+   */
+  protected function testMigrateUpgrade() {
+    $connection_options = $this->sourceDatabase->getConnectionOptions();
+    $this->drupalGet('/upgrade');
+    $this->assertText('Upgrade a Drupal site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the upgrading handbook for more detailed information.');
+
+    $this->drupalPostForm(NULL, [], t('Continue'));
+    $this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
+    $this->assertFieldByName('mysql[host]');
+    $edits = [
+      'driver' => $connection_options['driver'],
+      'mysql[host]' => $connection_options['host'],
+      'mysql[database]' => $connection_options['database'],
+      'mysql[username]' => $connection_options['username'],
+      'mysql[password]' => $connection_options['password'],
+      'mysql[port]' => $connection_options['port'],
+      'mysql[prefix]' => $connection_options['prefix']['default'],
+    ];
+    $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+    $this->assertResponse(200);
+    $this->assertText('Are you sure?');
+    $this->assertFieldsByValue('Perform upgrade');
+    $this->drupalPostForm(NULL, [], t('Perform upgrade'));
+    $this->assertText(t('Congratulations, you upgraded Drupal!'));
+  }
+}
diff --git a/src/Tests/d6/MigrateUpgrade6Test.php b/src/Tests/d6/MigrateUpgrade6Test.php
new file mode 100644
index 0000000..0a3e6ad
--- /dev/null
+++ b/src/Tests/d6/MigrateUpgrade6Test.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_upgrade\Tests\d6\MigrateUpgrade6Test.
+ */
+
+namespace Drupal\migrate_upgrade\Tests\d6;
+
+use Drupal\migrate_upgrade\Tests\MigrateUpgradeTestBase;
+
+/**
+ * @group migrate_upgrade
+ */
+class MigrateUpgrade6Test extends MigrateUpgradeTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->loadFixture(drupal_get_path('module','migrate_drupal') . '/tests/fixtures/drupal6.php');
+  }
+
+}
diff --git a/src/Tests/d7/MigrateUpgrade7Test.php b/src/Tests/d7/MigrateUpgrade7Test.php
new file mode 100644
index 0000000..384d6e4
--- /dev/null
+++ b/src/Tests/d7/MigrateUpgrade7Test.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_upgrade\Tests\d7\MigrateUpgrade6Test.
+ */
+
+namespace Drupal\migrate_upgrade\Tests\d7;
+
+use Drupal\migrate_upgrade\Tests\MigrateUpgradeTestBase;
+
+/**
+ * @group migrate_upgrade
+ */
+class MigrateUpgrade7Test extends MigrateUpgradeTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->loadFixture(drupal_get_path('module','migrate_drupal') . '/tests/fixtures/drupal7.php');
+  }
+
+}
