View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
use Drupal\field\Entity\FieldConfig;
class OrderFieldInstanceTest extends Ubercart6TestBase {
public static $modules = [
'commerce_number_pattern',
'commerce_order',
'commerce_price',
'commerce_product',
'commerce_store',
'migrate_plus',
'node',
'path',
'profile',
'state_machine',
'telephone',
'text',
'filter',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('commerce_store');
$this
->installEntitySchema('commerce_order');
$this
->installEntitySchema('profile');
$this
->installSchema('commerce_number_pattern', [
'commerce_number_pattern_sequence',
]);
$this
->installConfig('commerce_store');
$this
->installConfig('commerce_order');
$this
->executeMigrations([
'uc_order_field',
'uc_order_field_instance',
]);
}
public function testFieldInstanceMigration() {
$fields = [
'commerce_order.default.field_order_logs',
];
foreach ($fields as $field) {
$field_config = FieldConfig::load($field);
$this
->assertInstanceOf(FieldConfig::class, $field_config, "{$field} is not an instance of FieldConfig");
}
}
}