public function PreExistingTermMultipleParentImportExportTest::testTermImportExport1 in Acquia Content Hub 8.2
Performs tests with taxonomy term with multiple parents.
This test uses 3 local terms and 2 imported terms. One parent is local and the other one is imported.
File
- tests/
src/ Kernel/ PreExistingTermMultipleParentImportExportTest.php, line 190
Class
- PreExistingTermMultipleParentImportExportTest
- Tests terms with multiple parents during export and import.
Namespace
Drupal\Tests\acquia_contenthub\KernelCode
public function testTermImportExport1() {
// Create local terms: 0, 1, 4. Others should be imported.
$terms = [
0,
1,
4,
];
$this
->createTerms($terms);
$this
->assertEquals(3, count($this->terms), 'Created 3 local taxonomy terms.');
// We're not going to use this expectation.
$this
->importFixture(0);
$document = $this
->createCdfDocumentFromFixture(0);
$imported_uuids = array_keys($document
->getEntities());
// Verify every taxonomy term.
$this
->verifyTaxonomyTerm(0, $imported_uuids, FALSE);
$this
->verifyTaxonomyTerm(1, $imported_uuids, FALSE);
$this
->verifyTaxonomyTerm(2, $imported_uuids, TRUE);
$this
->verifyTaxonomyTerm(3, $imported_uuids, TRUE);
$this
->verifyTaxonomyTerm(4, $imported_uuids, FALSE);
}