protected function ParagraphEntityReferenceTest::getEntitiesDataArray in Entity Share 8.2
Helper function to get a mapping of the entities data.
Used to create the entities for the test and to test that it has been recreated properly.
Overrides EntityShareClientFunctionalTestBase::getEntitiesDataArray
File
- modules/
entity_share_client/ tests/ src/ Functional/ ParagraphEntityReferenceTest.php, line 43
Class
- ParagraphEntityReferenceTest
- Functional test class for paragraph entity reference field.
Namespace
Drupal\Tests\entity_share_client\FunctionalCode
protected function getEntitiesDataArray() {
return [
'paragraph' => [
'en' => [
'es_test_paragraph' => $this
->getCompleteParagraphInfos([
'field_es_test_text_plain' => [
'value' => $this->faker
->text(255),
'checker_callback' => 'getValue',
],
]),
],
],
'node' => [
'en' => [
// Paragraph reference.
'es_test_paragraph_reference' => $this
->getCompleteNodeInfos([
'field_es_test_paragraphs' => [
'value_callback' => function () {
return [
[
'target_id' => $this
->getEntityId('paragraph', 'es_test_paragraph'),
'target_revision_id' => $this
->getEntityRevisionId('paragraph', 'es_test_paragraph'),
],
];
},
'checker_callback' => 'getExpectedParagraphReferenceValue',
],
]),
],
],
];
}