class MigrateNodeDeriverTest

Same name in this branch
  1. 9 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeDeriverTest
Same name and namespace in other branches
  1. 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeDeriverTest
  2. 11.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeDeriverTest

Test D6NodeDeriver.

@group migrate_drupal_6

Hierarchy

Expanded class hierarchy of MigrateNodeDeriverTest

File

core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php, line 12

Namespace

Drupal\Tests\node\Kernel\Migrate\d6
View source
class MigrateNodeDeriverTest extends MigrateDrupal6TestBase {
  
  /**
   * The migration plugin manager.
   *
   * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface
   */
  protected $pluginManager;
  
  /**
   * {@inheritdoc}
   */
  public function setUp() : void {
    parent::setUp();
    $this->pluginManager = $this->container
      ->get('plugin.manager.migration');
  }
  
  /**
   * Tests node translation migrations with translation disabled.
   */
  public function testNoTranslations() {
    // Without content_translation, there should be no translation migrations.
    $migrations = $this->pluginManager
      ->createInstances('d6_node_translation');
    $this->assertSame([], $migrations, "No node translation migrations without content_translation");
  }
  
  /**
   * Tests node translation migrations with translation enabled.
   */
  public function testTranslations() {
    // With content_translation, there should be translation migrations for
    // each content type.
    $this->enableModules([
      'language',
      'content_translation',
    ]);
    $this->assertTrue($this->container
      ->get('plugin.manager.migration')
      ->hasDefinition('d6_node_translation:story'), "Node translation migrations exist after content_translation installed");
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.