Commit e12fd0d0 authored by alexpott's avatar alexpott
Browse files

Issue #2248501 by mbovan, Berdir: ImageItem should not have description and display properties

parent 0b132ec5
......@@ -145,6 +145,9 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['alt'] = DataDefinition::create('string')
->setLabel(t('Alternative text'))
->setDescription(t("Alternative image text, for the image's 'alt' attribute."));
......@@ -115,6 +115,11 @@ public function testImageItem() {
$entity = entity_create('entity_test', array('mame' => $this->randomMachineName()));
// Test image item properties.
$expected = array('target_id', 'entity', 'alt', 'title', 'width', 'height');
$properties = $entity->getFieldDefinition('image_test')->getFieldStorageDefinition()->getPropertyDefinitions();
$this->assertEqual(array_keys($properties), $expected);
// Test the generateSampleValue() method.
$entity = entity_create('entity_test');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment