diff --git a/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php b/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php
new file mode 100644
index 0000000..bebe235
--- /dev/null
+++ b/core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate\Plugin\migrate\source\DummyQueryTrait.
+ */
+
+namespace Drupal\migrate\Plugin\migrate\source;
+
+/**
+ * Trait providing a dummy select query object for source plugins based on
+ * SqlBase which override initializeIterator() to obtain their data from other
+ * SqlBase services instead of a direct query. This ensures that query() returns
+ * a valid object, even though it isn't used for iteration.
+ */
+trait DummyQueryTrait {
+
+  /**
+   * @return \Drupal\Core\Database\Query\SelectInterface
+   */
+  public function query() {
+    $query = $this->select('system', 's')
+      ->range(0, 1);
+    $query->addExpression('1');
+    return $query;
+  }
+
+}
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
index 98180d5..e644a04 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlSourceTestCase.php
@@ -59,6 +59,13 @@
   protected $expectedResults = array();
 
   /**
+   * Expected count of source rows.
+   *
+   * @var int
+   */
+  protected $expectedCount = 0;
+
+  /**
    * The source plugin instance under test.
    *
    * @var \Drupal\migrate\Plugin\MigrateSourceInterface
@@ -97,6 +104,7 @@ protected function setUp() {
       ->method('getSourcePlugin')
       ->will($this->returnValue($plugin));
     $this->source = $plugin;
+    $this->expectedCount = count($this->expectedResults);
   }
 
   /**
@@ -107,6 +115,13 @@ public function testRetrieval() {
   }
 
   /**
+   * Test the source returns the row count expected.
+   */
+  public function testSourceCount() {
+    $this->assertEquals($this->source->count(), $this->expectedCount);
+  }
+
+  /**
    * @param \Drupal\migrate\Row $row
    * @param string $key
    * @return mixed
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/CommentVariable.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/CommentVariable.php
index 8dfb5a8..e01d28d 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/CommentVariable.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/CommentVariable.php
@@ -8,6 +8,7 @@
 namespace Drupal\migrate_drupal\Plugin\migrate\source\d6;
 
 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+use Drupal\migrate\Plugin\migrate\source\DummyQueryTrait;
 
 /**
  * @MigrateSource(
@@ -16,6 +17,8 @@
  */
 class CommentVariable extends DrupalSqlBase {
 
+  use DummyQueryTrait;
+
   /**
    * {@inheritdoc}
    */
@@ -95,13 +98,6 @@ protected function commentPrefixes() {
   /**
    * {@inheritdoc}
    */
-  public function query() {
-    // Nothing to do here.
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function getIds() {
     $ids['node_type']['type'] = 'string';
     return $ids;
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php
index 6d5f891..1d7f9b2 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UploadInstance.php
@@ -8,6 +8,7 @@
 namespace Drupal\migrate_drupal\Plugin\migrate\source\d6;
 
 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+use Drupal\migrate\Plugin\migrate\source\DummyQueryTrait;
 
 /**
  * Drupal 6 upload instance source from database.
@@ -19,6 +20,8 @@
  */
 class UploadInstance extends DrupalSqlBase {
 
+  use DummyQueryTrait;
+
   /**
    * {@inheritdoc}
    */
@@ -63,8 +66,8 @@ public function getIds() {
   /**
    * {@inheritdoc}
    */
-  public function query() {
-    // Nothing needed here.
+  public function count() {
+    return count($this->getIterator());
   }
 
   /**
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UserPictureInstance.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UserPictureInstance.php
index 667a551..f3a9654 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UserPictureInstance.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d6/UserPictureInstance.php
@@ -8,6 +8,7 @@
 namespace Drupal\migrate_drupal\Plugin\migrate\source\d6;
 
 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+use Drupal\migrate\Plugin\migrate\source\DummyQueryTrait;
 
 /**
  * Drupal 6 user picture field instance source.
@@ -20,6 +21,8 @@
  */
 class UserPictureInstance extends DrupalSqlBase {
 
+  use DummyQueryTrait;
+
   /**
    * {@inheritdoc}
    */
@@ -36,6 +39,15 @@ public function initializeIterator() {
   /**
    * {@inheritdoc}
    */
+  public function count() {
+    // This source provides a single row, corresponding to a single picture
+    // field to be added to the user entity.
+    return 1;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function fields() {
     return array(
       'file_directory' => 'The directory to store images..',
@@ -52,11 +64,4 @@ public function getIds() {
     return $ids;
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function query() {
-    // Nothing to do here.
-  }
-
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
index 533cd3c..a02fbed 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_action_settings');
+    $this->migration = entity_load('migration', 'd6_action_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
index 69876f3..bde7d98 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_aggregator_settings');
+    $this->migration = entity_load('migration', 'd6_aggregator_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php
index 958d6bc..01ba1f4 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php
@@ -27,12 +27,12 @@ protected function setUp() {
     parent::setUp();
     $this->installEntitySchema('aggregator_feed');
 
-    $migration = entity_load('migration', 'd6_aggregator_feed');
+    $this->migration = entity_load('migration', 'd6_aggregator_feed');
     $dumps = array(
       $this->getDumpDirectory() . '/AggregatorFeed.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php
index 9e075ba..5cd0c02 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php
@@ -48,12 +48,12 @@ protected function setUp() {
     $entity->enforceIsNew();
     $entity->save();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_aggregator_item');
+    $this->migration = entity_load('migration', 'd6_aggregator_item');
     $dumps = array(
       $this->getDumpDirectory() . '/AggregatorItem.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php
index eb13b49..75a1077 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php
@@ -44,12 +44,12 @@ protected function setUp() {
       )
     ));
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_custom_block');
+    $this->migration = entity_load('migration', 'd6_custom_block');
     $dumps = array(
       $this->getDumpDirectory() . '/Boxes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
index a1ec049..02fd230 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
@@ -73,14 +73,14 @@ protected function setUp() {
     \Drupal::service('theme_handler')->install(array('test_theme'));
 
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_block');
+    $this->migration = entity_load('migration', 'd6_block');
     $dumps = array(
       $this->getDumpDirectory() . '/Blocks.php',
       $this->getDumpDirectory() . '/BlocksRoles.php',
       $this->getDumpDirectory() . '/AggregatorFeed.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
index deb3208..f2622d9 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
@@ -34,12 +34,12 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
   protected function setUp() {
     parent::setUp();
 
-    $migration = entity_load('migration', 'd6_book_settings');
+    $this->migration = entity_load('migration', 'd6_book_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php
index a98e827..989f282 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php
@@ -50,8 +50,8 @@ protected function setUp() {
     );
     $this->loadDumps($dumps);
     // Migrate books..
-    $migration = entity_load('migration', 'd6_book');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_book');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
index 2c0e9c5..0d71a29 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
@@ -61,7 +61,7 @@ protected function setUp() {
     $this->prepareMigrations($id_mappings);
 
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_comment');
+    $this->migration = entity_load('migration', 'd6_comment');
 
     $dumps = array(
       $this->getDumpDirectory() . '/Node.php',
@@ -72,8 +72,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/NodeType.php',
       $this->getDumpDirectory() . '/Comments.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php
index 6a4560b..bf71a6a 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php
@@ -31,14 +31,14 @@ protected function setUp() {
     $this->installConfig(['node', 'comment']);
 
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_comment_type');
+    $this->migration = entity_load('migration', 'd6_comment_type');
 
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
       $this->getDumpDirectory() . '/NodeType.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php
index cafd55d..104a397 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php
@@ -77,9 +77,9 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', static::MIGRATION);
-    $this->prepare($migration, $this->dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', static::MIGRATION);
+    $this->prepare($this->migration, $this->dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
index f382015..0e45e23 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
@@ -44,13 +44,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_comment_entity_form_display_subject');
+    $this->migration = entity_load('migration', 'd6_comment_entity_form_display_subject');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
       $this->getDumpDirectory() . '/NodeType.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php
index 0267dd4..7617efe 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php
@@ -43,13 +43,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_comment_field');
+    $this->migration = entity_load('migration', 'd6_comment_field');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
       $this->getDumpDirectory() . '/NodeType.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php
index 07b70c5..ba2ce62 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php
@@ -51,13 +51,13 @@ protected function setUp() {
       'translatable' => '0',
     ))->save();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_comment_field_instance');
+    $this->migration = entity_load('migration', 'd6_comment_field_instance');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
       $this->getDumpDirectory() . '/NodeType.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php
index dd01a6c..7aa26b5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php
@@ -31,12 +31,12 @@ class MigrateContactCategoryTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_contact_category');
+    $this->migration = entity_load('migration', 'd6_contact_category');
     $dumps = array(
       $this->getDumpDirectory() . '/Contact.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
index 1b48744..87c94c6 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
@@ -41,13 +41,13 @@ protected function setUp() {
       ),
     );
     $this->prepareMigrations($id_mappings);
-    $migration = entity_load('migration', 'd6_contact_settings');
+    $this->migration = entity_load('migration', 'd6_contact_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
       $this->getDumpDirectory() . '/Contact.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
index 48465d9..93b5867 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
@@ -26,12 +26,12 @@ class MigrateDateFormatTest extends MigrateDrupal6TestBase {
   protected function setUp() {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_date_formats');
+    $this->migration = entity_load('migration', 'd6_date_formats');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
index 33cca91..84caf04 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
@@ -33,12 +33,12 @@ class MigrateDblogConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_dblog_settings');
+    $this->migration = entity_load('migration', 'd6_dblog_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
index cad03da..df69eca 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
@@ -8,11 +8,20 @@
 namespace Drupal\migrate_drupal\Tests\d6;
 
 use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
+use Drupal\migrate\Entity\MigrationInterface;
+use Drupal\migrate\Plugin\migrate\source\SqlBase;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * Base class for Drupal 6 migration tests.
  */
 abstract class MigrateDrupal6TestBase extends MigrateDrupalTestBase {
+  /**
+   * The primary migration being tested.
+   *
+   * @var MigrationInterface
+   */
+  protected $migration;
 
   /**
    * {@inheritdoc}
@@ -29,4 +38,21 @@ protected function getDumpDirectory() {
     return parent::getDumpDirectory() . '/d6';
   }
 
+  /**
+   * Test that the source plugin provides a valid query and a valid count.
+   */
+  public function testSourcePlugin() {
+    if (isset($this->migration)) {
+      $source = $this->migration->getSourcePlugin();
+      // Make sure a SqlBase source has a valid query.
+      if ($source instanceof SqlBase) {
+        /** @var SqlBase $source */
+        $this->assertTrue($source->query() instanceof SelectInterface, 'SQL source plugin has valid query');
+      }
+      // Validate that any source returns a valid count.
+      $this->assertTrue(is_numeric($source->count()), 'Source plugin returns valid count');
+    }
+  }
+
+
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php
index 7780b2c..6d0f289 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php
@@ -66,7 +66,7 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_field_formatter_settings');
+    $this->migration = entity_load('migration', 'd6_field_formatter_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/ContentNodeFieldInstance.php',
       $this->getDumpDirectory() . '/ContentNodeField.php',
@@ -74,8 +74,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/ContentFieldTestTwo.php',
       $this->getDumpDirectory() . '/ContentFieldMultivalue.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
index 17c0949..e570d43 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
@@ -67,7 +67,7 @@ protected function setUp() {
     entity_create('node_type', array('type' => 'story'))->save();
     entity_create('node_type', array('type' => 'test_page'))->save();
 
-    $migration = entity_load('migration', 'd6_field_instance');
+    $this->migration = entity_load('migration', 'd6_field_instance');
     $dumps = array(
       $this->getDumpDirectory() . '/ContentNodeFieldInstance.php',
       $this->getDumpDirectory() . '/ContentNodeField.php',
@@ -77,8 +77,8 @@ protected function setUp() {
     );
     $this->createFields();
 
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
index 04a3f2e..af0538f 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
@@ -31,7 +31,7 @@ class MigrateFieldTest extends MigrateDrupal6TestBase {
   protected function setUp() {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_field');
+    $this->migration = entity_load('migration', 'd6_field');
     $dumps = array(
       $this->getDumpDirectory() . '/ContentNodeFieldInstance.php',
       $this->getDumpDirectory() . '/ContentNodeField.php',
@@ -39,8 +39,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/ContentFieldTestTwo.php',
       $this->getDumpDirectory() . '/ContentFieldMultivalue.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php
index b9b79bb..607d025 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php
@@ -62,7 +62,7 @@ protected function setUp() {
       ),
     );
     $this->prepareMigrations($id_mappings);
-    $migration = entity_load('migration', 'd6_field_instance_widget_settings');
+    $this->migration = entity_load('migration', 'd6_field_instance_widget_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/ContentNodeFieldInstance.php',
       $this->getDumpDirectory() . '/ContentNodeField.php',
@@ -70,8 +70,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/ContentFieldTestTwo.php',
       $this->getDumpDirectory() . '/ContentFieldMultivalue.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
index f1dd274..9418021 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
@@ -33,12 +33,12 @@ class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_file_settings');
+    $this->migration = entity_load('migration', 'd6_file_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php
index 0ec3b78..292f892 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php
@@ -48,12 +48,12 @@ protected function setUp() {
       $this->getDumpDirectory() . '/Files.php',
     );
     /** @var \Drupal\migrate\Entity\MigrationInterface $migration */
-    $migration = entity_load('migration', 'd6_file');
-    $source = $migration->get('source');
+    $this->migration = entity_load('migration', 'd6_file');
+    $source = $this->migration->get('source');
     $source['site_path'] = 'core/modules/simpletest';
-    $migration->set('source', $source);
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration->set('source', $source);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
     $this->standalone = TRUE;
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php
index 1c11f83..74c0902 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php
@@ -27,14 +27,14 @@ class MigrateFilterFormatTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_filter_format');
+    $this->migration = entity_load('migration', 'd6_filter_format');
     $dumps = array(
       $this->getDumpDirectory() . '/Filters.php',
       $this->getDumpDirectory() . '/FilterFormats.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
index f91dade..34b3b69 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
@@ -37,12 +37,12 @@ protected function setUp() {
         array(array(1), array('vocabulary_1_i_0_')),
       )
     ));
-    $migration = entity_load('migration', 'd6_forum_settings');
+    $this->migration = entity_load('migration', 'd6_forum_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
index 721745d..e26b2c7 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_locale_settings');
+    $this->migration = entity_load('migration', 'd6_locale_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
index d12a9e6..22aedc4 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateMenuConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_menu_settings');
+    $this->migration = entity_load('migration', 'd6_menu_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php
index 18aea25..24e460c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php
@@ -43,12 +43,12 @@ protected function setUp() {
       ),
     ));
 
-    $migration = entity_load('migration', 'd6_menu_links');
+    $this->migration = entity_load('migration', 'd6_menu_links');
     $dumps = array(
       $this->getDumpDirectory() . '/MenuLinks.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php
index e451992..5b7d7a5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php
@@ -25,12 +25,12 @@ class MigrateMenuTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_menu');
+    $this->migration = entity_load('migration', 'd6_menu');
     $dumps = array(
       $this->getDumpDirectory() . '/MenuCustom.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php
index 0a8d60b..216ada4 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php
@@ -74,8 +74,8 @@ public function setUp() {
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 
-    $migration = entity_load('migration', 'd6_node_setting_sticky');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_node_setting_sticky');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
index edf8b1a..d5d000c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
@@ -33,12 +33,12 @@ class MigrateNodeConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_node_settings');
+    $this->migration = entity_load('migration', 'd6_node_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php
index 41f3850..4b8715c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php
@@ -44,8 +44,8 @@ protected function setUp() {
     }
 
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_node_revision');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_node_revision');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php
index 8cb932f..e5abbbf 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php
@@ -24,12 +24,12 @@ class MigrateNodeTest extends MigrateNodeTestBase {
   protected function setUp() {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_node');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_node');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
     // This is required for the second import below.
-    db_truncate($migration->getIdMap()->mapTableName())->execute();
+    db_truncate($this->migration->getIdMap()->mapTableName())->execute();
     $this->standalone = TRUE;
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
index b79b495..2052412 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php
@@ -34,13 +34,13 @@ protected function setUp() {
 
     $this->installConfig(array('node'));
 
-    $migration = entity_load('migration', 'd6_node_type');
+    $this->migration = entity_load('migration', 'd6_node_type');
     $dumps = array(
       $this->getDumpDirectory() . '/NodeType.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
index 3e6e430..73c83c5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
@@ -33,12 +33,12 @@ class MigrateSearchConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_search_settings');
+    $this->migration = entity_load('migration', 'd6_search_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php
index a964ca2..7d7a9bf 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php
@@ -31,12 +31,12 @@ class MigrateSearchPageTest extends MigrateDrupal6TestBase {
   protected function setUp() {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_search_page');
+    $this->migration = entity_load('migration', 'd6_search_page');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
index 6ad86e8..bba5ecf 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
@@ -36,12 +36,12 @@ protected function setUp() {
 
     $this->installConfig(['simpletest']);
 
-    $migration = entity_load('migration', 'd6_simpletest_settings');
+    $this->migration = entity_load('migration', 'd6_simpletest_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
index d9b0246..6e3e83a 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
@@ -33,12 +33,12 @@ class MigrateStatisticsConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_statistics_settings');
+    $this->migration = entity_load('migration', 'd6_statistics_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
index 1b6fd40..7d92815 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateSyslogConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_syslog_settings');
+    $this->migration = entity_load('migration', 'd6_syslog_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
index 5bebe8f..4f5db58 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
@@ -23,12 +23,12 @@ class MigrateSystemCronTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_cron');
+    $this->migration = entity_load('migration', 'd6_system_cron');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
index 5b70f27..ae63a0b 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
@@ -23,12 +23,12 @@ class MigrateSystemFileTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_file');
+    $this->migration = entity_load('migration', 'd6_system_file');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
index c82bcc1..4440eb8 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
@@ -23,12 +23,12 @@ class MigrateSystemFilterTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_filter');
+    $this->migration = entity_load('migration', 'd6_system_filter');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
index 377a21c..59f38a0 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
@@ -23,12 +23,12 @@ class MigrateSystemImageGdTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_image_gd');
+    $this->migration = entity_load('migration', 'd6_system_image_gd');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
index 656fb9f..e1d8530 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
@@ -23,12 +23,12 @@ class MigrateSystemImageTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_image');
+    $this->migration = entity_load('migration', 'd6_system_image');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
index d3bd5e4..bc89bbb 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
@@ -25,12 +25,12 @@ class MigrateSystemLoggingTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_logging');
+    $this->migration = entity_load('migration', 'd6_system_logging');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
index ca0954c..1a76133 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
@@ -23,12 +23,12 @@ class MigrateSystemMaintenanceTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_maintenance');
+    $this->migration = entity_load('migration', 'd6_system_maintenance');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
index 2f13720..796a39f 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
@@ -23,12 +23,12 @@ class MigrateSystemPerformanceTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_performance');
+    $this->migration = entity_load('migration', 'd6_system_performance');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
index b89815c..0407212 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
@@ -23,12 +23,12 @@ class MigrateSystemRssTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_rss');
+    $this->migration = entity_load('migration', 'd6_system_rss');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
index d543c20..a58a367 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
@@ -23,12 +23,12 @@ class MigrateSystemSiteTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_system_site');
+    $this->migration = entity_load('migration', 'd6_system_site');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, new MigrateMessage());
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, new MigrateMessage());
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
index 11de9e8..e84cfbe 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateTaxonomyConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_taxonomy_settings');
+    $this->migration = entity_load('migration', 'd6_taxonomy_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php
index 4e5dcc3..536afcb 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php
@@ -35,15 +35,15 @@ protected function setUp() {
         array(array(3), array('vocabulary_3_i_2_')),
     )));
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_taxonomy_term');
+    $this->migration = entity_load('migration', 'd6_taxonomy_term');
     $dumps = array(
       $this->getDumpDirectory() . '/TermData.php',
       $this->getDumpDirectory() . '/TermHierarchy.php',
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php
index ba36183..9222f1a 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php
@@ -30,13 +30,13 @@ class MigrateTaxonomyVocabularyTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_taxonomy_vocabulary');
+    $this->migration = entity_load('migration', 'd6_taxonomy_vocabulary');
     $dumps = array(
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
index 915f7dc..7b0bdc5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateTextConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_text_settings');
+    $this->migration = entity_load('migration', 'd6_text_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
index ae9809d..3a48495 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
@@ -32,12 +32,12 @@ class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_update_settings');
+    $this->migration = entity_load('migration', 'd6_update_settings');
     $dumps = array(
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php
index 3008b9c..a7a540d 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php
@@ -41,13 +41,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_upload_entity_display');
+    $this->migration = entity_load('migration', 'd6_upload_entity_display');
     $dumps = array(
       $this->getDumpDirectory() . '/NodeType.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php
index f6d9cfc..81f8539 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php
@@ -41,13 +41,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_upload_entity_form_display');
+    $this->migration = entity_load('migration', 'd6_upload_entity_form_display');
     $dumps = array(
       $this->getDumpDirectory() . '/NodeType.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php
index f9abe79..03dacbf 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php
@@ -30,8 +30,8 @@ class MigrateUploadFieldTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_upload_field');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_upload_field');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php
index d66e3d1..f2b3c90 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php
@@ -52,13 +52,13 @@ protected function setUp() {
       'translatable' => '0',
     ))->save();
 
-    $migration = entity_load('migration', 'd6_upload_field_instance');
+    $this->migration = entity_load('migration', 'd6_upload_field_instance');
     $dumps = array(
       $this->getDumpDirectory() . '/NodeType.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php
index 14df717..ce9d311 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php
@@ -23,8 +23,8 @@ class MigrateUploadTest extends MigrateUploadBase {
   protected function setUp() {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_upload');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_upload');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php
index 572861d..b3aab2c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php
@@ -27,12 +27,12 @@ protected function setUp() {
 
     $this->installSchema('system', ['url_alias']);
 
-    $migration = entity_load('migration', 'd6_url_alias');
+    $this->migration = entity_load('migration', 'd6_url_alias');
     $dumps = array(
       $this->getDumpDirectory() . '/UrlAlias.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
index 0c9636a..bb6fa64 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
@@ -33,8 +33,8 @@ protected function setUp() {
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 
-    $migration = entity_load('migration', 'd6_user_settings');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_settings');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php
index a4a0a18..6ff2c55 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php
@@ -50,8 +50,8 @@ protected function setUp() {
     $this->prepareMigrations($id_mappings);
 
     // Migrate users.
-    $migration = entity_load('migration', 'd6_user_contact_settings');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_contact_settings');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php
index 4d88e4a..2a3cb2c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php
@@ -37,8 +37,8 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_user_picture_entity_display');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_picture_entity_display');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php
index 9dbdd4a..f918426 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php
@@ -36,8 +36,8 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_user_picture_entity_form_display');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_picture_entity_form_display');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php
index eac1c3d..11595af 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php
@@ -25,8 +25,8 @@ class MigrateUserPictureFieldTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_user_picture_field');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_picture_field');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php
index 969176c..666f65a 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php
@@ -40,12 +40,12 @@ protected function setUp() {
       $this->getDumpDirectory() . '/EventTimezones.php',
     );
     /** @var \Drupal\migrate\Entity\MigrationInterface $migration */
-    $migration = entity_load('migration', 'd6_user_picture_file');
-    $source = $migration->get('source');
+    $this->migration = entity_load('migration', 'd6_user_picture_file');
+    $source = $this->migration->get('source');
     $source['site_path'] = 'core/modules/simpletest';
-    $migration->set('source', $source);
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration->set('source', $source);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php
index e032ff0..d6f81c0 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php
@@ -44,8 +44,8 @@ protected function setUp() {
       'translatable' => '0',
     ))->save();
 
-    $migration = entity_load('migration', 'd6_user_picture_field_instance');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user_picture_field_instance');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php
index 5492526..7d0d812 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php
@@ -74,7 +74,7 @@ protected function setUp() {
       'type' => 'boolean',
     ))->save();
 
-    $migration = entity_load('migration', 'd6_user_profile_entity_display');
+    $this->migration = entity_load('migration', 'd6_user_profile_entity_display');
     $dumps = array(
       $this->getDumpDirectory() . '/ProfileFields.php',
       $this->getDumpDirectory() . '/Users.php',
@@ -82,7 +82,7 @@ protected function setUp() {
       $this->getDumpDirectory() . '/UsersRoles.php',
       $this->getDumpDirectory() . '/EventTimezones.php',
     );
-    $this->prepare($migration, $dumps);
+    $this->prepare($this->migration, $dumps);
     $field_data = Database::getConnection('default', 'migrate')
       ->select('profile_fields', 'u')
       ->fields('u')
@@ -98,7 +98,7 @@ protected function setUp() {
         'required' => 1,
       ))->save();
     }
-    $executable = new MigrateExecutable($migration, $this);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php
index a127ded..0f6f7b2 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php
@@ -69,7 +69,7 @@ protected function setUp() {
       'type' => 'boolean',
     ))->save();
 
-    $migration = entity_load('migration', 'd6_user_profile_entity_form_display');
+    $this->migration = entity_load('migration', 'd6_user_profile_entity_form_display');
     $dumps = array(
       $this->getDumpDirectory() . '/ProfileFields.php',
       $this->getDumpDirectory() . '/Users.php',
@@ -77,7 +77,7 @@ protected function setUp() {
       $this->getDumpDirectory() . '/UsersRoles.php',
       $this->getDumpDirectory() . '/EventTimezones.php',
     );
-    $this->prepare($migration, $dumps);
+    $this->prepare($this->migration, $dumps);
 
     $field_data = Database::getConnection('default', 'migrate')
       ->select('profile_fields', 'u')
@@ -95,7 +95,7 @@ protected function setUp() {
       ))->save();
     }
 
-    $executable = new MigrateExecutable($migration, $this);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php
index 101ab0c..c50fd48 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php
@@ -34,7 +34,7 @@ protected function setUp() {
     $this->prepareMigrations($id_mappings);
     $this->createFields();
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_user_profile_field_instance');
+    $this->migration = entity_load('migration', 'd6_user_profile_field_instance');
     $dumps = array(
       $this->getDumpDirectory() . '/ProfileFields.php',
       $this->getDumpDirectory() . '/Users.php',
@@ -42,8 +42,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/UsersRoles.php',
       $this->getDumpDirectory() . '/EventTimezones.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php
index 4388c22..27ff8ea 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php
@@ -25,7 +25,7 @@ class MigrateUserProfileFieldTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_user_profile_field');
+    $this->migration = entity_load('migration', 'd6_user_profile_field');
     $dumps = array(
       $this->getDumpDirectory() . '/ProfileFields.php',
       $this->getDumpDirectory() . '/Users.php',
@@ -33,8 +33,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/UsersRoles.php',
       $this->getDumpDirectory() . '/EventTimezones.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php
index 63fb233..ab4cb2c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php
@@ -141,8 +141,8 @@ protected function setUp() {
     }
 
     // Migrate profile fields.
-    $migration_format = entity_load('migration', 'd6_profile_values:user');
-    $executable = new MigrateExecutable($migration_format, $this);
+    $this->migration = entity_load('migration', 'd6_profile_values:user');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
index 3c62d49..ace1a99 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php
@@ -40,7 +40,7 @@ protected function setUp() {
     $this->prepareMigrations($id_mappings);
 
     /** @var \Drupal\migrate\entity\Migration $migration */
-    $migration = entity_load('migration', 'd6_user_role');
+    $this->migration = entity_load('migration', 'd6_user_role');
     $dumps = array(
       $this->getDumpDirectory() . '/Permission.php',
       $this->getDumpDirectory() . '/Role.php',
@@ -48,8 +48,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/FilterFormats.php',
       $this->getDumpDirectory() . '/Variable.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
index d7ebec0..054fc3e 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
@@ -126,8 +126,8 @@ protected function setUp() {
     $this->prepareMigrations($id_mappings);
 
     // Migrate users.
-    $migration = entity_load('migration', 'd6_user');
-    $executable = new MigrateExecutable($migration, $this);
+    $this->migration = entity_load('migration', 'd6_user');
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php
index 729e2ad..66a5156 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php
@@ -30,7 +30,7 @@ class MigrateViewModesTest extends MigrateDrupal6TestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $migration = entity_load('migration', 'd6_view_modes');
+    $this->migration = entity_load('migration', 'd6_view_modes');
     $dumps = array(
       $this->getDumpDirectory() . '/ContentNodeFieldInstance.php',
       $this->getDumpDirectory() . '/ContentNodeField.php',
@@ -38,8 +38,8 @@ protected function setUp() {
       $this->getDumpDirectory() . '/ContentFieldTestTwo.php',
       $this->getDumpDirectory() . '/ContentFieldMultivalue.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php
index 46cb5c2..edbe442 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php
@@ -71,13 +71,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_vocabulary_entity_display');
+    $this->migration = entity_load('migration', 'd6_vocabulary_entity_display');
     $dumps = array(
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php
index 7a07405..c5d7ad3 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php
@@ -71,13 +71,13 @@ protected function setUp() {
     );
     $this->prepareMigrations($id_mappings);
 
-    $migration = entity_load('migration', 'd6_vocabulary_entity_form_display');
+    $this->migration = entity_load('migration', 'd6_vocabulary_entity_form_display');
     $dumps = array(
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
 
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php
index 52e60c1..c8ae237 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php
@@ -64,13 +64,13 @@ protected function setUp() {
       ),
     ))->save();
 
-    $migration = entity_load('migration', 'd6_vocabulary_field_instance');
+    $this->migration = entity_load('migration', 'd6_vocabulary_field_instance');
     $dumps = array(
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php
index 7ac3455..1f6c466 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php
@@ -45,13 +45,13 @@ protected function setUp() {
       'vid' => 'test_vocab',
     ))->save();
 
-    $migration = entity_load('migration', 'd6_vocabulary_field');
+    $this->migration = entity_load('migration', 'd6_vocabulary_field');
     $dumps = array(
       $this->getDumpDirectory() . '/Vocabulary.php',
       $this->getDumpDirectory() . '/VocabularyNodeTypes.php',
     );
-    $this->prepare($migration, $dumps);
-    $executable = new MigrateExecutable($migration, $this);
+    $this->prepare($this->migration, $dumps);
+    $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
   }
 
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/TermSourceWithVocabularyFilterTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/TermSourceWithVocabularyFilterTest.php
index f209b0d..30c42af 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/TermSourceWithVocabularyFilterTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/TermSourceWithVocabularyFilterTest.php
@@ -23,5 +23,7 @@ protected function setUp() {
     $this->expectedResults = array_values(array_filter($this->expectedResults, function($result) {
       return $result['vid'] == 5;
     }));
+    // We know there are two rows with vid == 5.
+    $this->expectedCount = 2;
   }
 }
