You are here

public function RangeFieldTest::testAlterFieldInstanceMigration in Range 8

Same name in this branch
  1. 8 tests/src/Unit/Plugin/migrate/field/d6/RangeFieldTest.php \Drupal\Tests\range\Unit\Plugin\migrate\field\d6\RangeFieldTest::testAlterFieldInstanceMigration()
  2. 8 tests/src/Unit/Plugin/migrate/field/d7/RangeFieldTest.php \Drupal\Tests\range\Unit\Plugin\migrate\field\d7\RangeFieldTest::testAlterFieldInstanceMigration()

@covers ::alterFieldInstanceMigration @dataProvider alterMigrationDataProvider

File

tests/src/Unit/Plugin/migrate/field/d7/RangeFieldTest.php, line 108

Class

RangeFieldTest
@coversDefaultClass \Drupal\range\Plugin\migrate\field\d7\RangeField @group range

Namespace

Drupal\Tests\range\Unit\Plugin\migrate\field\d7

Code

public function testAlterFieldInstanceMigration($field_type, $is_range_field_type) {
  $this->row
    ->expects(self::once())
    ->method('getSourceProperty')
    ->willReturn($field_type);
  $this->plugin
    ->alterFieldInstanceMigration($this->migration);
  $process = $this->migration
    ->getProcess();
  if ($is_range_field_type) {
    $expected_process = [
      'plugin' => 'd7_range_field_instance_settings',
    ];
    $this
      ->assertSame([
      $expected_process,
    ], $process['settings']);
  }
  else {
    $this
      ->assertSame([], $process);
  }
}