function LayoutEntityHelperTraitTest::providerTestIsEntityUsingFieldOverride
Dataprovider for testIsEntityUsingFieldOverride().
File
-
core/
modules/ layout_builder/ tests/ src/ Unit/ LayoutEntityHelperTraitTest.php, line 40
Class
- LayoutEntityHelperTraitTest
- @coversDefaultClass \Drupal\layout_builder\LayoutEntityHelperTrait
Namespace
Drupal\Tests\layout_builder\UnitCode
public function providerTestIsEntityUsingFieldOverride() {
$data['non fieldable entity'] = [
$this->prophesize(EntityInterface::class)
->reveal(),
FALSE,
];
$fieldable_entity = $this->prophesize(FieldableEntityInterface::class);
$fieldable_entity->hasField(OverridesSectionStorage::FIELD_NAME)
->willReturn(FALSE);
$data['fieldable entity without layout field'] = [
$fieldable_entity->reveal(),
FALSE,
];
$entity_using_field = $this->prophesize(FieldableEntityInterface::class);
$entity_using_field->hasField(OverridesSectionStorage::FIELD_NAME)
->willReturn(TRUE);
$data['fieldable entity with layout field'] = [
$entity_using_field->reveal(),
TRUE,
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.