You are here

public function FixtureBase::trackUserContent in Lightning Core 8.5

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

Marks content by the current user to be deleted after the scenario.

Parameters

\Drupal\DrupalUserManagerInterface $user_manager: The Drupal Extension's user manager.

string $entity_type_id: The entity type ID to track. Any entities of this type created by the current user will be deleted automatically after the scenario.

File

tests/src/FixtureBase.php, line 93

Class

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

Namespace

Drupal\Tests\lightning_core

Code

public function trackUserContent(DrupalUserManagerInterface $user_manager, $entity_type_id) {
  $this->userManager = $user_manager;
  $this->trackedEntityTypes[$entity_type_id] = $entity_type_id;
}