protected function BlazyCreationTestTrait::createReferencingEntity in Blazy 8.2
Same name and namespace in other branches
- 8 tests/src/Traits/BlazyCreationTestTrait.php \Drupal\Tests\blazy\Traits\BlazyCreationTestTrait::createReferencingEntity()
Create referencing entity.
1 call to BlazyCreationTestTrait::createReferencingEntity()
- BlazyViewsFileTest::buildContents in tests/
src/ Kernel/ Views/ BlazyViewsFileTest.php - Build contents.
File
- tests/
src/ Traits/ BlazyCreationTestTrait.php, line 460
Class
- BlazyCreationTestTrait
- A Trait common for Blazy tests.
Namespace
Drupal\Tests\blazy\TraitsCode
protected function createReferencingEntity(array $data = []) {
if (empty($data['values']) && $this->referencedEntity
->id()) {
$data['values'] = [
$this->entityFieldName => [
[
'target_id' => $this->referencedEntity
->id(),
],
],
];
}
return $this
->setUpContentWithItems($this->bundle, $data);
}