Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate_drupal_ui / tests / src / Functional / d6 / MigrateUpgrade6Test.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal_ui\Functional\d6;
4
5 use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase;
6 use Drupal\user\Entity\User;
7
8 /**
9  * Tests Drupal 6 upgrade using the migrate UI.
10  *
11  * The test method is provided by the MigrateUpgradeTestBase class.
12  *
13  * @group migrate_drupal_ui
14  */
15 class MigrateUpgrade6Test extends MigrateUpgradeExecuteTestBase {
16
17   /**
18    * Modules to enable.
19    *
20    * @var array
21    */
22   public static $modules = [
23     'language',
24     'content_translation',
25     'migrate_drupal_ui',
26     'telephone',
27     'aggregator',
28     'book',
29     'forum',
30     'statistics',
31     'migration_provider_test',
32   ];
33
34   /**
35    * {@inheritdoc}
36    */
37   protected function setUp() {
38     parent::setUp();
39     $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal6.php');
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   protected function getSourceBasePath() {
46     return __DIR__ . '/files';
47   }
48
49   /**
50    * {@inheritdoc}
51    */
52   protected function getEntityCounts() {
53     return [
54       'aggregator_item' => 1,
55       'aggregator_feed' => 2,
56       'block' => 35,
57       'block_content' => 2,
58       'block_content_type' => 1,
59       'comment' => 6,
60       // The 'standard' profile provides the 'comment' comment type, and the
61       // migration creates 12 comment types, one per node type.
62       'comment_type' => 13,
63       'contact_form' => 5,
64       'configurable_language' => 5,
65       'editor' => 2,
66       'field_config' => 84,
67       'field_storage_config' => 58,
68       'file' => 8,
69       'filter_format' => 7,
70       'image_style' => 5,
71       'language_content_settings' => 2,
72       'migration' => 105,
73       'node' => 17,
74       // The 'book' module provides the 'book' node type, and the migration
75       // creates 12 node types.
76       'node_type' => 13,
77       'rdf_mapping' => 7,
78       'search_page' => 2,
79       'shortcut' => 2,
80       'shortcut_set' => 1,
81       'action' => 23,
82       'menu' => 8,
83       'taxonomy_term' => 8,
84       'taxonomy_vocabulary' => 7,
85       'tour' => 4,
86       'user' => 7,
87       'user_role' => 6,
88       'menu_link_content' => 5,
89       'view' => 16,
90       'date_format' => 11,
91       'entity_form_display' => 29,
92       'entity_form_mode' => 1,
93       'entity_view_display' => 53,
94       'entity_view_mode' => 14,
95       'base_field_override' => 38,
96     ];
97   }
98
99   /**
100    * {@inheritdoc}
101    */
102   protected function getEntityCountsIncremental() {
103     $counts = $this->getEntityCounts();
104     $counts['block_content'] = 3;
105     $counts['comment'] = 7;
106     $counts['entity_view_display'] = 53;
107     $counts['entity_view_mode'] = 14;
108     $counts['file'] = 9;
109     $counts['menu_link_content'] = 6;
110     $counts['node'] = 18;
111     $counts['taxonomy_term'] = 9;
112     $counts['user'] = 8;
113     $counts['view'] = 16;
114     return $counts;
115   }
116
117   /**
118    * {@inheritdoc}
119    */
120   protected function getAvailablePaths() {
121     return [
122       'aggregator',
123       'block',
124       'book',
125       'comment',
126       'contact',
127       'content',
128       'date',
129       'dblog',
130       'email',
131       'filefield',
132       'filter',
133       'forum',
134       'i18ntaxonomy',
135       'imagecache',
136       'imagefield',
137       'language',
138       'link',
139       'locale',
140       'menu',
141       'node',
142       'nodereference',
143       'optionwidgets',
144       'path',
145       'profile',
146       'search',
147       'statistics',
148       'system',
149       'taxonomy',
150       'text',
151       'upload',
152       'user',
153       'userreference',
154       // Include modules that do not have an upgrade path and are enabled in the
155       // source database, defined in the $noUpgradePath property
156       // in MigrateUpgradeForm.
157       'date_api',
158       'date_timezone',
159       'event',
160       'i18n',
161       'i18nstrings',
162       'imageapi',
163       'number',
164       'php',
165       'profile',
166       'variable_admin',
167     ];
168   }
169
170   /**
171    * {@inheritdoc}
172    */
173   protected function getMissingPaths() {
174     return [
175       'i18nblocks',
176       'i18ncck',
177       'i18ncontent',
178       'i18nmenu',
179       // This module is in the missing path list because it is installed on the
180       // source site but it is not installed on the destination site.
181       'i18nprofile',
182     ];
183   }
184
185   /**
186    * Executes all steps of migrations upgrade.
187    */
188   public function testMigrateUpgradeExecute() {
189     parent::testMigrateUpgradeExecute();
190
191     // Ensure migrated users can log in.
192     $user = User::load(2);
193     $user->passRaw = 'john.doe_pass';
194     $this->drupalLogin($user);
195   }
196
197 }