Skip to content
Snippets Groups Projects
Commit 8fc6f242 authored by Alexey Korepov's avatar Alexey Korepov
Browse files

Issue #3423972 by Murz, stomusic: Support fields provided by Drupal core Options module

parent f848db92
No related branches found
No related tags found
1 merge request!88Issue #3423972 by stomusic, Murz: Support fields provided by Drupal core Options module
Pipeline #142446 passed with warnings
......@@ -54,6 +54,7 @@ class TypedDataManagerStub extends TypedDataManager {
'Drupal\text\Plugin\Field\FieldType',
'Drupal\image\Plugin\Field\FieldType',
'Drupal\link\Plugin\Field\FieldType',
'Drupal\options\Plugin\Field\FieldType',
'Drupal\test_helpers\Plugin\Field\FieldType',
];
break;
......
......@@ -70,10 +70,16 @@ class FieldItemListStubFactoryTest extends UnitTestCase {
$definition2 = FieldItemListStubFactory::createFieldItemDefinitionStub(MapItem::class, NULL, TRUE);
$this->assertTrue($definition2->isBaseField());
$type = 'map';
$field = TestHelpers::createFieldStub([], 'map');
$this->assertEquals('field_item:map', $field->getItemDefinition()->getDataType());
$this->assertEquals("field_item:$type", $field->getItemDefinition()->getDataType());
$this->assertEquals([], $field->getValue());
$type = 'list_string';
$field = TestHelpers::createFieldStub(['foo', 'bar'], $type);
$this->assertEquals("field_item:$type", $field->getItemDefinition()->getDataType());
$this->assertEquals([['value' => 'foo'], ['value' => 'bar']], $field->getValue());
// Testing mocked methods.
$field = TestHelpers::createFieldStub([], 'map', NULL, NULL, NULL,
['generateSampleItems'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment