You are here

public function FieldTargetDefinitionTest::testGetPropertyLabelWithCustomSetLabel in Feeds 8.3

Tests that a custom set property label takes precedence.

@covers ::getPropertyLabel

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit

Code

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