You are here

protected function FeedsMockingTrait::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.

20 calls to FeedsMockingTrait::getMockFieldDefinition()
BooleanTest::testPrepareValue in tests/src/Unit/Feeds/Target/BooleanTest.php
@covers ::prepareValue
DateRangeTest::setUp in tests/src/Unit/Feeds/Target/DateRangeTest.php
DateTimeTest::setUp in tests/src/Unit/Feeds/Target/DateTimeTest.php
DateTimeTest::testGetTimezoneConfiguration in tests/src/Unit/Feeds/Target/DateTimeTest.php
Test the timezone configuration.
DateTimeTest::testPrepareValue in tests/src/Unit/Feeds/Target/DateTimeTest.php
Tests preparing a value that succeeds.

... See full list

1 method overrides FeedsMockingTrait::getMockFieldDefinition()
PathTest::getMockFieldDefinition in tests/src/Unit/Feeds/Target/PathTest.php
Mocks a field definition.

File

tests/src/Traits/FeedsMockingTrait.php, line 108

Class

FeedsMockingTrait
Provides methods for mocking certain Feeds classes.

Namespace

Drupal\Tests\feeds\Traits

Code

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