Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / language / tests / src / Kernel / Plugin / migrate / source / d6 / LanguageContentTaxonomyVocabularySettingsTest.php
1 <?php
2
3 namespace Drupal\Tests\language\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests i18ntaxonomy vocabulary setting source plugin.
9  *
10  * @covers \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettingsTaxonomyVocabulary
11  *
12  * @group language
13  */
14 class LanguageContentTaxonomyVocabularySettingsTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['taxonomy', 'language', 'migrate_drupal'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $tests = [];
26
27     // The source data.
28     $tests[0]['source_data']['vocabulary'] = [
29       [
30         'vid' => 1,
31         'name' => 'Tags',
32         'description' => 'Tags description.',
33         'help' => 1,
34         'relations' => 0,
35         'hierarchy' => 0,
36         'multiple' => 0,
37         'required' => 0,
38         'tags' => 1,
39         'module' => 'taxonomy',
40         'weight' => 0,
41         'language' => '',
42       ],
43       [
44         'vid' => 2,
45         'name' => 'Categories',
46         'description' => 'Categories description.',
47         'help' => 1,
48         'relations' => 1,
49         'hierarchy' => 1,
50         'multiple' => 0,
51         'required' => 1,
52         'tags' => 0,
53         'module' => 'taxonomy',
54         'weight' => 0,
55         'language' => 'zu',
56       ],
57     ];
58     $tests[0]['source_data']['variable'] = [
59       [
60         'name' => 'i18ntaxonomy_vocabulary',
61         'value' => 'a:4:{i:1;s:1:"3";i:2;s:1:"2";i:3;s:1:"3";i:5;s:1:"1";}',
62       ],
63     ];
64
65     $tests[0]['expected_data'] = [
66       [
67         'vid' => 1,
68         'language' => '',
69         'state' => 3,
70       ],
71       [
72         'vid' => 2,
73         'language' => 'zu',
74         'state' => 2,
75       ],
76     ];
77
78     return $tests;
79   }
80
81 }