public function TaxonomyEntityReferenceTest::testReferencedEntityCreated in Entity Share 8.3
Same name and namespace in other branches
- 8.2 modules/entity_share_client/tests/src/Functional/TaxonomyEntityReferenceTest.php \Drupal\Tests\entity_share_client\Functional\TaxonomyEntityReferenceTest::testReferencedEntityCreated()
Test that a referenced entity is pulled even if not selected.
This test that:
- an taxonomy entity reference field is working
- the parent base field on taxonomy entities is working.
File
- modules/
entity_share_client/ tests/ src/ Functional/ TaxonomyEntityReferenceTest.php, line 94
Class
- TaxonomyEntityReferenceTest
- Functional test class for taxonomy entity reference field.
Namespace
Drupal\Tests\entity_share_client\FunctionalCode
public function testReferencedEntityCreated() {
// Select only the referencing node entity.
$selected_entities = [
'es_test_taxonomy_reference',
];
$prepared_url = $this
->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
// Prepare import context.
$import_context = new ImportContext($this->remote
->id(), 'node_es_test_en', $this::IMPORT_CONFIG_ID);
$this->importService
->prepareImport($import_context);
// Imports data from the remote URL.
$this->importService
->importFromUrl($prepared_url);
$this
->checkCreatedEntities();
}