Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @file
* Contains \Drupal\Tests\taxonomy\Unit\Migrate\d7\VocabularyTest.
*/
namespace Drupal\Tests\taxonomy\Unit\Migrate\d7;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* Tests D7 vocabulary source plugin.
*
* @group taxonomy
*/
class VocabularyTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\taxonomy\Plugin\migrate\source\d7\Vocabulary';
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd7_vocabulary',
],
];
protected $expectedResults = [
[
'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',
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseContents['taxonomy_vocabulary'] = $this->expectedResults;
parent::setUp();
}
}