protected function ContentEntityReferenceTest::getEntitiesDataArray in Entity Share 8.2
Same name and namespace in other branches
- 8.3 modules/entity_share_client/tests/src/Functional/ContentEntityReferenceTest.php \Drupal\Tests\entity_share_client\Functional\ContentEntityReferenceTest::getEntitiesDataArray()
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/ ContentEntityReferenceTest.php, line 46
Class
- ContentEntityReferenceTest
- Functional test class for content entity reference field.
Namespace
Drupal\Tests\entity_share_client\FunctionalCode
protected function getEntitiesDataArray() {
return [
'node' => [
'en' => [
// Used for internal reference.
'es_test_to_be_referenced' => $this
->getCompleteNodeInfos([
'status' => [
'value' => NodeInterface::PUBLISHED,
'checker_callback' => 'getValue',
],
]),
// Content reference.
'es_test_content_reference' => $this
->getCompleteNodeInfos([
'field_es_test_content_reference' => [
'value_callback' => function () {
return [
[
'target_id' => $this
->getEntityId('node', 'es_test_to_be_referenced'),
],
];
},
'checker_callback' => 'getExpectedContentReferenceValue',
],
]),
],
],
];
}