You are here

public function FieldTargetDefinitionTest::testGetPropertyLabel in Feeds 8.3

Tests that the label is taken from field definition.

@covers ::getPropertyLabel

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit

Code

public function testGetPropertyLabel() {
  $this->propertyDefinition
    ->getLabel()
    ->willReturn('Foo label')
    ->shouldBeCalled();
  $this->itemDefinition
    ->getPropertyDefinition('foo')
    ->willReturn($this->propertyDefinition
    ->reveal())
    ->shouldBeCalled();
  $field_definition = $this
    ->createFieldDefinition();
  $target_definition = FieldTargetDefinition::createFromFieldDefinition($field_definition
    ->reveal());
  $this
    ->assertEquals('Foo label', $target_definition
    ->getPropertyLabel('foo'));
}