MigrateTaxonomyTermTest.php

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

Namespace

Drupal\Tests\forum\Kernel\Migrate\d6

File

core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php

View source
<?php

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

use Drupal\Tests\forum\Kernel\Migrate\MigrateTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;

/**
 * Test migration of forum taxonomy terms.
 *
 * @group forum
 */
class MigrateTaxonomyTermTest extends MigrateDrupal6TestBase {
    use MigrateTestTrait;
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'taxonomy',
        'comment',
        'forum',
        'menu_ui',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->installEntitySchema('taxonomy_term');
        $this->installConfig('forum');
        $this->executeMigrations([
            'd6_taxonomy_vocabulary',
            'd6_taxonomy_term',
        ]);
    }
    
    /**
     * Gets the path to the fixture file.
     */
    protected function getFixtureFilePath() {
        return __DIR__ . '/../../../../fixtures/drupal6.php';
    }
    
    /**
     * Assert the forum taxonomy terms.
     */
    public function testTaxonomyTerms() {
        $this->assertEntity(8, 'en', 'General discussion', 'forums', '', NULL, 2, [
            '0',
        ], 0);
        $this->assertEntity(9, 'en', 'Earth', 'forums', '', NULL, 0, [
            '0',
        ], 1);
        $this->assertEntity(10, 'en', 'Birds', 'forums', '', NULL, 0, [
            '9',
        ], 0);
        $this->assertEntity(11, 'en', 'Oak', 'trees', '', NULL, 0, [
            '0',
        ], NULL);
        $this->assertEntity(12, 'en', 'Ash', 'trees', '', NULL, 0, [
            '0',
        ], NULL);
    }

}

Classes

Title Deprecated Summary
MigrateTaxonomyTermTest Test migration of forum taxonomy terms.

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