Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / node / tests / src / Kernel / Migrate / d7 / MigrateNodeDeriverTest.php
index 2b7169a6cb8376a50de24499a4b5388f17fe32a6..437126803d1c0828f8237ecb5dace4f439634635 100644 (file)
@@ -11,38 +11,17 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
  */
 class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
 
-  /**
-   * The migration plugin manager.
-   *
-   * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface
-   */
-  protected $pluginManager;
-
-  /**
-   * The module handler service.
-   *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface
-   */
-  protected $moduleHandler;
-
   /**
    * {@inheritdoc}
    */
-  public function setUp() {
-    parent::setUp();
-    $this->pluginManager = $this->container->get('plugin.manager.migration');
-    $this->moduleHandler = $this->container->get('module_handler');
-  }
+  public static $modules = ['node'];
 
   /**
    * Test node translation migrations with translation disabled.
    */
   public function testNoTranslations() {
-    // Enabling node module for this test.
-    $this->enableModules(['node']);
     // Without content_translation, there should be no translation migrations.
-    $migrations = $this->pluginManager->createInstances('d7_node_translation');
-    $this->assertTrue($this->moduleHandler->moduleExists('node'));
+    $migrations = $this->container->get('plugin.manager.migration')->createInstances('d7_node_translation');
     $this->assertEmpty($migrations);
   }
 
@@ -52,10 +31,8 @@ class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
   public function testTranslations() {
     // With content_translation, there should be translation migrations for
     // each content type.
-    $this->enableModules(['language', 'content_translation', 'node', 'filter']);
-    $migrations = $this->pluginManager->createInstances('d7_node_translation');
-    $this->assertArrayHasKey('d7_node_translation:article', $migrations,
-      "Node translation migrations exist after content_translation installed");
+    $this->enableModules(['language', 'content_translation', 'filter']);
+    $this->assertTrue($this->container->get('plugin.manager.migration')->hasDefinition('d7_node_translation:article'), "Node translation migrations exist after content_translation installed");
   }
 
 }