You are here

protected function EnvironmentTestTrait::createTestEnvironment in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Traits/EnvironmentTestTrait.php \Drupal\Tests\build_hooks\Traits\EnvironmentTestTrait::createTestEnvironment()

Creates a test environment.

2 calls to EnvironmentTestTrait::createTestEnvironment()
DeploymentStorageHandlerTest::setUp in tests/src/Kernel/DeploymentStorageHandlerTest.php
DeploymentValidationTest::setUp in tests/src/Kernel/DeploymentValidationTest.php

File

tests/src/Traits/EnvironmentTestTrait.php, line 23

Class

EnvironmentTestTrait
Defines a trait for creating an environment.

Namespace

Drupal\Tests\build_hooks\Traits

Code

protected function createTestEnvironment() {
  $this->environment = FrontendEnvironment::create([
    'id' => 'foo',
    'label' => $this
      ->randomMachineName(),
    'settings' => [],
    'plugin' => 'build_hooks_test',
    'deployment_strategy' => Trigger::DEPLOYMENT_STRATEGY_ENTITYSAVE,
  ]);
  $this->environment
    ->save();
}