You are here

public function UbercartFieldStorageGenerateTest::testProviderInvalidInputs in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x modules/ubercart/tests/src/Kernel/Plugin/process/UbercartFieldStorageGenerateTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\UbercartFieldStorageGenerateTest::testProviderInvalidInputs()
  2. 3.0.x modules/ubercart/tests/src/Kernel/Plugin/process/UbercartFieldStorageGenerateTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\UbercartFieldStorageGenerateTest::testProviderInvalidInputs()

Tests UbercartFieldStorageGenerate process plugin.

@dataProvider providerInvalidInputs

File

modules/ubercart/tests/src/Kernel/Plugin/process/UbercartFieldStorageGenerateTest.php, line 95

Class

UbercartFieldStorageGenerateTest
Tests the UbercartFieldStorageGenerate plugin.

Namespace

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

Code

public function testProviderInvalidInputs($value = NULL, $source_properties = NULL, $destination_properties = NULL, $expected = NULL) {
  $migrateExecutable = $this
    ->getMockBuilder('Drupal\\migrate\\MigrateExecutable')
    ->disableOriginalConstructor()
    ->getMock();
  $migration_plugin_manager = \Drupal::service('plugin.manager.migration');
  $plugin = new UbercartFieldStorageGenerate([], 'test', [], $migration_plugin_manager, '');
  $row = new Row();
  foreach ($source_properties as $name => $datum) {
    $row
      ->setSourceProperty($name, $datum);
  }
  foreach ($destination_properties as $name => $datum) {
    $row
      ->setDestinationProperty($name, $datum);
  }
  $new_value = $plugin
    ->transform($value, $migrateExecutable, $row, 'destination_property');
  $this
    ->assertSame($expected, $new_value);
}