View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
use Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait;
class ProductAttributeValueTest extends Ubercart6TestBase {
use CommerceMigrateTestTrait;
protected static $modules = [
'commerce_price',
'commerce_product',
'commerce_store',
];
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('commerce_product_variation');
$this
->installEntitySchema('commerce_product_attribute_value');
$this
->installEntitySchema('commerce_store');
$this
->executeMigrations([
'uc_attribute_field',
'uc_product_attribute',
'uc_product_attribute_value',
]);
}
public function testProductAttributeValue() {
$this
->assertProductAttributeValueEntity('1', 'design', 'Heart of Gold', 'Heart of Gold', '0');
$this
->assertProductAttributeValueEntity('2', 'design', 'Trillian', 'Trillian', '0');
$this
->assertProductAttributeValueEntity('3', 'design', 'Pan Galactic Gargle Blaster', 'Pan Galactic Gargle Blaster', '0');
$this
->assertProductAttributeValueEntity('4', 'color', 'White', 'White', '500');
$this
->assertProductAttributeValueEntity('5', 'color', 'Gold', 'Gold', '500');
$this
->assertProductAttributeValueEntity('6', 'model_size_attribute', 'Keychain', 'Keychain', '20');
$this
->assertProductAttributeValueEntity('7', 'model_size_attribute', 'Desk', 'Desk', '400');
}
}