View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
abstract class Ubercart6TestBase extends MigrateDrupal6TestBase {
public static $modules = [
'address',
'commerce',
'entity',
'entity_reference_revisions',
'inline_entity_form',
'views',
'commerce_migrate',
'commerce_migrate_ubercart',
];
protected function getFixtureFilePath() {
return __DIR__ . '/../../../../fixtures/uc6.php';
}
protected function migrateAttributes() {
$this
->installEntitySchema('commerce_product');
$this
->installEntitySchema('commerce_product_variation');
$this
->installConfig([
'commerce_product',
]);
$this
->executeMigrations([
'uc_attribute_field',
'uc_product_attribute',
'uc_attribute_field_instance',
'uc_attribute_instance_widget_settings',
]);
}
protected function migrateContentTypes() {
parent::migrateContentTypes();
$this
->installEntitySchema('commerce_product');
$this
->executeMigration('uc6_product_type');
}
protected function migrateFields() {
$this
->migrateContentTypes();
$this
->executeMigrations([
'd6_field',
'd6_field_instance',
'd6_field_instance_widget_settings',
'd6_view_modes',
'd6_field_formatter_settings',
]);
}
protected function migrateOrders() {
$this
->migrateOrderItems();
$this
->executeMigrations([
'uc_order_field',
'uc_order_field_instance',
'uc6_order',
]);
}
protected function migrateOrderItems() {
$this
->installEntitySchema('view');
$this
->installEntitySchema('profile');
$this
->installEntitySchema('commerce_product');
$this
->installEntitySchema('commerce_product_variation');
$this
->installEntitySchema('commerce_order');
$this
->installEntitySchema('commerce_order_item');
$this
->installEntitySchema('node');
$this
->migrateStore();
$this
->installSchema('commerce_number_pattern', [
'commerce_number_pattern_sequence',
]);
$this
->installConfig([
'commerce_order',
'commerce_product',
]);
$this
->migrateContentTypes();
$this
->migrateAttributes();
$this
->executeMigrations([
'd6_language_content_settings',
'd6_node_settings',
'uc6_language_content_settings',
'uc6_product_variation',
'd6_node',
'uc6_profile_billing',
'uc6_order_product',
]);
}
protected function migrateProducts() {
$this
->migrateProductVariations();
}
protected function migrateProductVariations() {
$this
->installEntitySchema('commerce_currency');
$this
->installEntitySchema('commerce_store');
$this
->installConfig([
'commerce_store',
]);
$this
->installEntitySchema('node');
$this
->installEntitySchema('path_alias');
$this
->installEntitySchema('view');
$this
->installEntitySchema('commerce_product_variation');
$this
->installEntitySchema('commerce_product');
$this
->installConfig(static::$modules);
$this
->migrateStore();
$this
->migrateUsers(FALSE);
$this
->migrateFields();
$this
->migrateAttributes();
$this
->executeMigrations([
'language',
'd6_language_content_settings',
'd6_node_settings',
'uc6_language_content_settings',
'uc6_product_variation_type',
'uc6_product_variation',
'd6_node',
'd6_node_translation',
]);
}
protected function migrateStore() {
$this
->installEntitySchema('commerce_store');
$this
->migrateUsers(FALSE);
$this
->executeMigrations([
'uc_currency',
'uc6_store',
]);
}
}