public function CommerceAttributeTargetTypeTest::providerTestCommerceAttributeTargetType in Commerce Migrate 8.2
Same name and namespace in other branches
- 3.1.x modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceAttributeTargetTypeTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommerceAttributeTargetTypeTest::providerTestCommerceAttributeTargetType()
- 3.0.x modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceAttributeTargetTypeTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommerceAttributeTargetTypeTest::providerTestCommerceAttributeTargetType()
Data provider for testCommerceAttributeTargetType().
File
- modules/
commerce/ tests/ src/ Unit/ Plugin/ migrate/ process/ commerce1/ CommerceAttributeTargetTypeTest.php, line 48
Class
- CommerceAttributeTargetTypeTest
- Tests the CommerceAttributeTargetType plugin.
Namespace
Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1Code
public function providerTestCommerceAttributeTargetType() {
// Tests when this is an attribute value.
$entity_type = 'commerce_product';
$type = 'taxonomy_term_reference';
$instances = [
[
'data' => serialize([
'widget' => [
'type' => 'options_select',
],
]),
],
];
$tests[0]['source_properties'] = [
$entity_type,
$type,
$instances,
];
$tests[0]['destination_property'] = 'original_target_type';
$tests[0]['expected'] = 'commerce_product_attribute_value';
// Tests when not an attribute value.
$entity_type = 'commerce_product';
$type = 'taxonomy_term_reference';
$instances = [
[
'data' => serialize([
'widget' => [
'type' => 'text',
],
]),
],
];
$tests[1]['source_properties'] = [
$entity_type,
$type,
$instances,
];
$tests[1]['destination_property'] = 'original_target_type';
$tests[1]['expected'] = 'original_target_type';
return $tests;
}