You are here

protected function PathTest::getMockFieldDefinition in Feeds 8.3

Mocks a field definition.

Parameters

array $settings: The field storage and instance settings.

Return value

\Drupal\Core\Field\FieldDefinitionInterface A mocked field definition.

Overrides FeedsMockingTrait::getMockFieldDefinition

1 call to PathTest::getMockFieldDefinition()
PathTest::testPrepareValue in tests/src/Unit/Feeds/Target/PathTest.php
@covers ::prepareValue

File

tests/src/Unit/Feeds/Target/PathTest.php, line 32

Class

PathTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\Path @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

protected function getMockFieldDefinition(array $settings = []) {
  $definition = $this
    ->createMock(FieldDefinitionInterface::class);
  $definition
    ->expects($this
    ->any())
    ->method('getSettings')
    ->will($this
    ->returnValue($settings));
  $definition
    ->expects($this
    ->atLeastOnce())
    ->method('getFieldStorageDefinition')
    ->will($this
    ->returnValue($this
    ->createMock(FieldStorageDefinitionInterface::class)));
  return $definition;
}