You are here

public function FieldTargetDefinitionTest::testGetPropertyDescription in Feeds 8.3

Tests that the description is taken from field definition.

@covers ::getPropertyDescription

File

tests/src/Unit/FieldTargetDefinitionTest.php, line 112

Class

FieldTargetDefinitionTest
@coversDefaultClass \Drupal\feeds\FieldTargetDefinition @group feeds

Namespace

Drupal\Tests\feeds\Unit

Code

public function testGetPropertyDescription() {
  $this->propertyDefinition
    ->getDescription()
    ->willReturn('Foo description')
    ->shouldBeCalled();
  $this->itemDefinition
    ->getPropertyDefinition('foo')
    ->willReturn($this->propertyDefinition
    ->reveal())
    ->shouldBeCalled();
  $field_definition = $this
    ->createFieldDefinition();
  $target_definition = FieldTargetDefinition::createFromFieldDefinition($field_definition
    ->reveal());
  $this
    ->assertEquals('Foo description', $target_definition
    ->getPropertyDescription('foo'));
}