You are here

public function CommerceAttributeTargetTypeTest::providerTestException in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceAttributeTargetTypeTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommerceAttributeTargetTypeTest::providerTestException()
  2. 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::providerTestException()

Data provider for testException().

File

modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceAttributeTargetTypeTest.php, line 105

Class

CommerceAttributeTargetTypeTest
Tests the CommerceAttributeTargetType plugin.

Namespace

Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1

Code

public function providerTestException() {
  $tests = [];

  // Empty array of instances.
  $tests[0]['source_properties'] = [
    'commerce_product',
    'taxonomy_term_reference',
    [],
  ];
  $tests[0]['destination_property'] = 'original_target_type';
  $tests[0]['expected'] = "No instances for attribute for destination 'original_target_type'";

  // Instances is NULL.
  $tests[1] = $tests[0];
  $tests[1]['source_properties'] = [
    'commerce_product',
    'taxonomy_term_reference',
    NULL,
  ];
  $tests[1]['destination_property'] = 'original_target_type';
  $tests[1]['expected'] = "No instances for attribute for destination 'original_target_type'";
  return $tests;
}