protected function EnvironmentTestTrait::createTestEnvironment in Build Hooks 3.x
Same name and namespace in other branches
- 8.2 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\TraitsCode
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();
}