You are here

protected function FixtureBase::save in Lightning Core 8.5

Same name and namespace in other branches
  1. 8.3 tests/src/FixtureBase.php \Drupal\Tests\lightning_core\FixtureBase::save()
  2. 8.4 tests/src/FixtureBase.php \Drupal\Tests\lightning_core\FixtureBase::save()

Saves an entity and marks it for automatic deletion.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to save.

See also

::tearDown()

1 call to FixtureBase::save()
FixtureContext::setUp in tests/src/FixtureContext.php
Performs set-up tasks before a test scenario.

File

tests/src/FixtureBase.php, line 142

Class

FixtureBase
Base class for contexts which set up and tear down a complete test fixture.

Namespace

Drupal\Tests\lightning_core

Code

protected function save(EntityInterface $entity) {
  $entity
    ->save();
  array_push($this->entities, $entity);
}