MigrateTaxonomyTermTranslationTest.php

Same filename in this branch
  1. 11.x core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
  2. 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
Same filename in other branches
  1. 9 core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
  2. 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
  3. 8.9.x core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
  4. 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
  5. 10 core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
  6. 10 core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php
  7. 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php

Namespace

Drupal\Tests\forum\Kernel\Migrate\d7

File

core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php

View source
<?php

namespace Drupal\Tests\forum\Kernel\Migrate\d7;

use Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyTermTranslationTest as TaxonomyTermTranslationTest;

/**
 * Test migration of translated taxonomy terms.
 *
 * @group forum
 */
class MigrateTaxonomyTermTranslationTest extends TaxonomyTermTranslationTest {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'comment',
        'forum',
    ];
    
    /**
     * Gets the path to the fixture file.
     */
    protected function getFixtureFilePath() {
        return __DIR__ . '/../../../../fixtures/drupal7.php';
    }
    
    /**
     * Tests the Drupal i18n  taxonomy term to Drupal 8 migration.
     */
    public function testTaxonomyTermTranslation() {
        // Forums vocabulary, no multilingual option.
        $this->assertEntity(1, 'en', 'General discussion', 'forums', NULL, NULL, 2, []);
        $this->assertEntity(5, 'en', 'Custom Forum', 'forums', 'Where the cool kids are.', NULL, 3, []);
        $this->assertEntity(6, 'en', 'Games', 'forums', NULL, NULL, 4, []);
        $this->assertEntity(7, 'en', 'Minecraft', 'forums', NULL, NULL, 1, [
            '6',
        ]);
        $this->assertEntity(8, 'en', 'Half Life 3', 'forums', NULL, NULL, 0, [
            '6',
        ]);
    }

}

Classes

Title Deprecated Summary
MigrateTaxonomyTermTranslationTest Test migration of translated taxonomy terms.

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