Newer
Older
namespace Drupal\Tests\migrate_drupal_ui\Functional\d7;
use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase;
use Drupal\user\Entity\User;
/**
* Tests Drupal 7 upgrade using the migrate UI.
*
* The test method is provided by the MigrateUpgradeTestBase class.
*
* @group migrate_drupal_ui
*/
class MigrateUpgrade7Test extends MigrateUpgradeTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['file'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal7.php');
}
/**
* {@inheritdoc}
*/
protected function getSourceBasePath() {
return __DIR__ . '/files';
}
/**
* {@inheritdoc}
*/
protected function getEntityCounts() {
return [
'aggregator_item' => 10,
'aggregator_feed' => 1,
'block' => 25,
'block_content' => 1,
'block_content_type' => 1,
'comment' => 1,
// The 'standard' profile provides the 'comment' comment type, and the
// migration creates 6 comment types, one per node type.
Angie Byron
committed
'comment_type' => 7,
// Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
'configurable_language' => 4,
'contact_form' => 3,
'editor' => 2,
'field_config' => 61,
'field_storage_config' => 44,
'file' => 3,
'filter_format' => 7,
'image_style' => 6,
'language_content_settings' => 2,
'migration' => 73,
'node' => 5,
'node_type' => 6,
'rdf_mapping' => 7,
'search_page' => 2,
'shortcut' => 6,
'shortcut_set' => 2,
'action' => 17,
'menu' => 6,
'taxonomy_term' => 18,
'taxonomy_vocabulary' => 4,
'tour' => 4,
'user' => 4,
'user_role' => 3,
'menu_link_content' => 7,
'view' => 16,
'date_format' => 11,
Angie Byron
committed
'entity_form_display' => 17,
'entity_form_mode' => 1,
Angie Byron
committed
'entity_view_display' => 28,
'entity_view_mode' => 14,
'base_field_override' => 9,
];
}
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
* {@inheritdoc}
*/
protected function getAvailablePaths() {
return [
'aggregator',
'block',
'comment',
'contact',
'date',
'dblog',
'email',
'entityreference',
'field',
'field_sql_storage',
'file',
'filefield',
'filter',
'forum',
'image',
'imagefield',
'link',
'list',
'locale',
'menu',
'node',
'node_reference',
'number',
'options',
'optionwidgets',
'path',
'phone',
'search',
'shortcut',
'statistics',
'system',
'taxonomy',
'text',
'translation',
'user',
'user_reference',
];
}
/**
* {@inheritdoc}
*/
protected function getMissingPaths() {
return [
'blog',
'book',
'color',
'contextual',
'date_api',
'entity',
'field_ui',
'help',
'php',
'rdf',
'simpletest',
'syslog',
'toolbar',
'tracker',
'trigger',
'update',
];
}
/**
* Executes all steps of migrations upgrade.
*/
public function testMigrateUpgrade() {
parent::testMigrateUpgrade();
// Ensure migrated users can log in.
$user = User::load(2);
$user->passRaw = 'a password';
$this->drupalLogin($user);
}