VocabularyTest.php

Same filename in this branch
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/VocabularyTest.php
  2. 8.9.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTest.php
Same filename in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/VocabularyTest.php
  2. 9 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTest.php
  3. 9 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/VocabularyTest.php
  4. 10 core/modules/jsonapi/tests/src/Functional/VocabularyTest.php
  5. 10 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTest.php
  6. 10 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/VocabularyTest.php
  7. 11.x core/modules/jsonapi/tests/src/Functional/VocabularyTest.php
  8. 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTest.php
  9. 11.x core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/VocabularyTest.php

Namespace

Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7

File

core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/VocabularyTest.php

View source
<?php

namespace Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7;

use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;

/**
 * Tests D7 vocabulary source plugin.
 *
 * @covers \Drupal\taxonomy\Plugin\migrate\source\d7\Vocabulary
 * @group taxonomy
 */
class VocabularyTest extends MigrateSqlSourceTestBase {
    
    /**
     * {@inheritdoc}
     */
    public static $modules = [
        'taxonomy',
        'migrate_drupal',
    ];
    
    /**
     * {@inheritdoc}
     */
    public function providerSource() {
        $tests = [];
        // The source data.
        $tests[0]['source_data']['taxonomy_vocabulary'] = [
            [
                'vid' => 1,
                'name' => 'Tags',
                'description' => 'Tags description.',
                'hierarchy' => 0,
                'module' => 'taxonomy',
                'weight' => 0,
                'machine_name' => 'tags',
            ],
            [
                'vid' => 2,
                'name' => 'Categories',
                'description' => 'Categories description.',
                'hierarchy' => 1,
                'module' => 'taxonomy',
                'weight' => 0,
                'machine_name' => 'categories',
            ],
        ];
        // The expected results.
        $tests[0]['expected_data'] = $tests[0]['source_data']['taxonomy_vocabulary'];
        return $tests;
    }

}

Classes

Title Deprecated Summary
VocabularyTest Tests D7 vocabulary source plugin.

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