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