public function EntityContext::tearDown in Lightning Core 8.5
Same name and namespace in other branches
- 8 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::tearDown()
- 8.2 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::tearDown()
- 8.3 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::tearDown()
- 8.4 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::tearDown()
Deletes entities created during the scenario.
@afterScenario
File
- tests/
contexts/ EntityContext.behat.inc, line 75
Class
- EntityContext
- Contains miscellaneous step definitions for working with Drupal entities.
Namespace
Acquia\LightningExtension\ContextCode
public function tearDown() {
foreach ($this->trash as $entity_type => $ids) {
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
$entities = \Drupal::entityTypeManager()
->getStorage($entity_type)
->loadMultiple($ids);
foreach ($entities as $entity) {
$entity
->delete();
}
}
}