You are here

public function TaxonomyTermDeriverTest::testBuilder in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\TaxonomyTermDeriverTest::testBuilder()

Tests fields exist in process pipeline for term migrations.

File

core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php, line 21

Class

TaxonomyTermDeriverTest
Tests d7 taxonomy term deriver.

Namespace

Drupal\Tests\taxonomy\Kernel\Migrate

Code

public function testBuilder() {

  // Test a field on the vocabfixed term.
  $process = $this
    ->getMigration('d7_taxonomy_term:vocabfixed')
    ->getProcess();
  $this
    ->assertSame('field_training', $process['field_training'][0]['source']);

  // Test a field on the vocablocalized term.
  $process = $this
    ->getMigration('d7_taxonomy_term:vocablocalized')
    ->getProcess();
  $this
    ->assertSame('field_sector', $process['field_sector'][0]['source']);

  // Test a field on the vocabtranslate term.
  $process = $this
    ->getMigration('d7_taxonomy_term:vocabtranslate')
    ->getProcess();
  $this
    ->assertSame('field_chancellor', $process['field_chancellor'][0]['source']);

  // Test a field on the test_vocabulary term.
  $process = $this
    ->getMigration('d7_taxonomy_term:test_vocabulary')
    ->getProcess();
  $this
    ->assertSame('field_integer', $process['field_integer'][0]['source']);
  $this
    ->assertSame('field_term_reference', $process['field_term_reference'][0]['source']);
}