$this->
assertSame([$entity_1->
id(),
$entity_4->
id(),
$entity_2->
id()],
array_keys($called), 'The most dependent entities have ConfigEntityInterface::onDependencyRemoval() called first.'
);
$this->
assertSame(['config' =>
[], 'content' =>
[], 'module' =>
['node'
], 'theme' =>
[]],
$called[$entity_1->
id()]);
$this->
assertSame(['config' =>
[], 'content' =>
[], 'module' =>
['node'
], 'theme' =>
[]],
$called[$entity_2->
id()]);
$this->
assertSame(['config' =>
[], 'content' =>
[], 'module' =>
['node'
], 'theme' =>
[]],
$called[$entity_4->
id()]);
// Perform the uninstall.
$config_manager->
uninstall('module', 'node'
);
// Test that expected actions have been performed.
$entity_1 =
$storage->
load($entity_1->
id());
$this->
assertNotEmpty($entity_1, 'Entity 1 not deleted'
);
$this->
assertSame($entity_1->
getThirdPartySettings('node'
),
[], 'Entity 1 third party settings updated.'
);
$entity_2 =
$storage->
load($entity_2->
id());
$this->
assertNotEmpty($entity_2, 'Entity 2 not deleted'
);
$this->
assertSame($entity_2->
getThirdPartySettings('node'
),
[], 'Entity 2 third party settings updated.'
);
$this->
assertSame($entity_2->
calculateDependencies()->
getDependencies()['config'
],
[$entity_1->
getConfigDependencyName()], 'Entity 2 still depends on entity 1.'
);
$entity_3 =
$storage->
load($entity_3->
id());
$this->
assertNotEmpty($entity_3, 'Entity 3 not deleted'
);
$this->
assertSame($entity_3->
calculateDependencies()->
getDependencies()['config'
],
[$entity_2->
getConfigDependencyName()], 'Entity 3 still depends on entity 2.'
);
$this->
assertNull($storage->
load($entity_4->
id()), 'Entity 4 deleted'
);
} /**
* Tests deleting a configuration entity and dependency management.
*/