94a42e2c956463cfd8e65b767565099809be4323
[yaffs-website] / web / core / modules / migrate_drupal_ui / src / Tests / d7 / MigrateUpgrade7Test.php
1 <?php
2
3 namespace Drupal\migrate_drupal_ui\Tests\d7;
4
5 use Drupal\migrate_drupal_ui\Tests\MigrateUpgradeTestBase;
6 use Drupal\user\Entity\User;
7
8 /**
9  * Tests Drupal 7 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 MigrateUpgrade7Test extends MigrateUpgradeTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   protected function setUp() {
21     parent::setUp();
22     $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal7.php');
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   protected function getSourceBasePath() {
29     return __DIR__ . '/files';
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function getEntityCounts() {
36     return [
37       'aggregator_item' => 10,
38       'aggregator_feed' => 1,
39       'block' => 25,
40       'block_content' => 1,
41       'block_content_type' => 1,
42       'comment' => 1,
43       'comment_type' => 8,
44       // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
45       'configurable_language' => 4,
46       'contact_form' => 3,
47       'editor' => 2,
48       'field_config' => 52,
49       'field_storage_config' => 39,
50       'file' => 2,
51       'filter_format' => 7,
52       'image_style' => 6,
53       'language_content_settings' => 2,
54       'migration' => 73,
55       'node' => 3,
56       'node_type' => 6,
57       'rdf_mapping' => 7,
58       'search_page' => 2,
59       'shortcut' => 6,
60       'shortcut_set' => 2,
61       'action' => 16,
62       'menu' => 6,
63       'taxonomy_term' => 18,
64       'taxonomy_vocabulary' => 4,
65       'tour' => 4,
66       'user' => 4,
67       'user_role' => 3,
68       'menu_link_content' => 7,
69       'view' => 14,
70       'date_format' => 11,
71       'entity_form_display' => 18,
72       'entity_form_mode' => 1,
73       'entity_view_display' => 29,
74       'entity_view_mode' => 14,
75       'base_field_override' => 9,
76     ];
77   }
78
79   /**
80    * Executes all steps of migrations upgrade.
81    */
82   public function testMigrateUpgrade() {
83     parent::testMigrateUpgrade();
84
85     // Ensure migrated users can log in.
86     $user = User::load(2);
87     $user->pass_raw = 'a password';
88     $this->drupalLogin($user);
89   }
90
91 }