You are here

public function CommerceFieldNameTest::testCommerceFieldNameOther in Commerce Migrate 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceFieldNameTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommerceFieldNameTest::testCommerceFieldNameOther()
  2. 3.1.x modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceFieldNameTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommerceFieldNameTest::testCommerceFieldNameOther()

Tests CommerceFieldName plugin for other entity types.

@dataProvider providerCommerceFieldNameOther

File

modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommerceFieldNameTest.php, line 229

Class

CommerceFieldNameTest
Tests the CommerceFieldName plugin.

Namespace

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

Code

public function testCommerceFieldNameOther($source_properties = NULL, $expected = NULL) {
  $this->makeEntityUnique
    ->expects($this
    ->never())
    ->method('transform');
  $this->row
    ->expects($this
    ->never())
    ->method('getDestinationProperty');
  $this->row
    ->method('getSourceProperty')
    ->will($this
    ->onConsecutiveCalls($source_properties[0], $source_properties[1], $source_properties[2], $source_properties[3]));
  $value = $this->plugin
    ->transform('', $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame($expected, $value);
}