View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
use Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait;
use Drupal\profile\Entity\Profile;
class ProfileTest extends Commerce1TestBase {
use CommerceMigrateTestTrait;
public static $modules = [
'address',
'commerce_number_pattern',
'commerce_order',
'commerce_price',
'commerce_product',
'commerce_store',
'migrate_plus',
'path',
];
protected function setUp() {
parent::setUp();
$this
->migrateProfiles();
}
public function testProfile() {
$this
->assertProfile(1, 'customer', '4', 'und', TRUE, TRUE, '1493287440', NULL);
$this
->assertProfile(2, 'shipping', '4', 'und', TRUE, TRUE, '1493287445', '1493287450');
$this
->assertProfile(3, 'shipping', '4', 'und', TRUE, FALSE, '1493287450', '1493287455');
$this
->assertProfileRevision(4, 'customer', '4', 'und', TRUE, FALSE, '1508452606', NULL);
$profile = Profile::load(1);
$address = $profile
->get('address')
->first()
->getValue();
$this
->assertAddressField($address, 'US', 'CA', 'Visalia', NULL, '93277-8329', '', '16 Hampton Ct', NULL, 'Sample', NULL, 'Customer', NULL);
$profile = Profile::load(4);
$address = $profile
->get('address')
->first()
->getValue();
$this
->assertAddressField($address, 'NZ', '', 'Visalia', '', '93277-8329', '', '16 Hampton Ct', '', 'Sample', NULL, 'Customer', NULL);
}
}