You are here

protected function RangeFieldTest::setUp 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::setUp()
  2. 8 tests/src/Unit/Plugin/migrate/field/d7/RangeFieldTest.php \Drupal\Tests\range\Unit\Plugin\migrate\field\d7\RangeFieldTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

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

Namespace

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

Code

protected function setUp() : void {
  parent::setUp();
  $this->row = $this
    ->createMock(Row::class);
  $this->migrationSource = $this
    ->createMock(MigrateSourceInterface::class);
  $this->migrationSource
    ->expects(self::once())
    ->method('current')
    ->willReturn($this->row);
  $this->migration = $this
    ->createPartialMock(Migration::class, [
    'getSourcePlugin',
  ]);
  $this->migration
    ->expects(self::once())
    ->method('getSourcePlugin')
    ->willReturn($this->migrationSource);
  $this->plugin = new RangeField([], 'range', self::PLUGIN_DEFINITION);
}