You are here

protected function EntityDefinitionUpdateTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides EntityUnitTestBase::setUp

File

core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php, line 49
Contains \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest.

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\system\Tests\Entity

Code

protected function setUp() {
  parent::setUp();
  $this->entityDefinitionUpdateManager = $this->container
    ->get('entity.definition_update_manager');
  $this->database = $this->container
    ->get('database');

  // Install every entity type's schema that wasn't installed in the parent
  // method.
  foreach (array_diff_key($this->entityManager
    ->getDefinitions(), array_flip(array(
    'user',
    'entity_test',
  ))) as $entity_type_id => $entity_type) {
    $this
      ->installEntitySchema($entity_type_id);
  }
}