You are here

protected function CommerceMigrateTestTrait::assertProductAttributeValueEntity in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertProductAttributeValueEntity()
  2. 3.0.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertProductAttributeValueEntity()

Asserts a product attribute value entity.

Parameters

string $id: The attribute value id.

string $attribute_id: The expected product attribute value id.

string $name: The expected name of the product attribute value.

string $label: The expected label of the product attribute value.

string $weight: The expected weight of the product attribute value.

5 calls to CommerceMigrateTestTrait::assertProductAttributeValueEntity()
AttributeTermTest::testMigrateProductAttributeValueTest in modules/commerce/tests/src/Kernel/Migrate/commerce1/AttributeTermTest.php
Test attribute migrations from Commerce 1.
AttributeValueTest::testMigrateProductAttributeValueTest in modules/csv_example/tests/src/Kernel/Migrate/AttributeValueTest.php
Test currency migration from Drupal 6 to 8.
ProductAttributeValueTest::testProductAttributeValue in modules/magento/tests/src/Kernel/Migrate/magento2/ProductAttributeValueTest.php
Tests product attribute value migration.
ProductAttributeValueTest::testProductAttributeValue in modules/ubercart/tests/src/Kernel/Migrate/uc7/ProductAttributeValueTest.php
Test product attribute value migration.
ProductAttributeValueTest::testProductAttributeValue in modules/ubercart/tests/src/Kernel/Migrate/uc6/ProductAttributeValueTest.php
Test product attribute value migration.

File

tests/src/Kernel/CommerceMigrateTestTrait.php, line 467

Class

CommerceMigrateTestTrait
Helper function to test migrations.

Namespace

Drupal\Tests\commerce_migrate\Kernel

Code

protected function assertProductAttributeValueEntity($id, $attribute_id, $name, $label, $weight) {
  $attribute_value = ProductAttributeValue::load($id);
  $this
    ->assertInstanceOf(ProductAttributeValue::class, $attribute_value);
  $this
    ->assertSame($attribute_id, $attribute_value
    ->getAttributeId());
  $this
    ->assertSame($name, $attribute_value
    ->getName());
  $this
    ->assertSame($label, $attribute_value
    ->label());
  $this
    ->assertSame($weight, $attribute_value
    ->getWeight());
}