You are here

public static function TestRunnerKernel::createFromRequest in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/TestRunnerKernel.php \Drupal\Core\Test\TestRunnerKernel::createFromRequest()
  2. 10 core/lib/Drupal/Core/Test/TestRunnerKernel.php \Drupal\Core\Test\TestRunnerKernel::createFromRequest()

Create a DrupalKernel object from a request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request.

$class_loader: The class loader. Normally Composer's ClassLoader, as included by the front controller, but may also be decorated.

string $environment: String indicating the environment, e.g. 'prod' or 'dev'.

bool $allow_dumping: (optional) FALSE to stop the container from being written to or read from disk. Defaults to TRUE.

string $app_root: (optional) The path to the application root as a string. If not supplied, the application root will be computed.

Return value

static

Throws

\Symfony\Component\HttpKernel\Exception\BadRequestHttpException In case the host name in the request is not trusted.

Overrides DrupalKernel::createFromRequest

2 calls to TestRunnerKernel::createFromRequest()
FunctionalTestSetupTrait::prepareEnvironment in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Prepares the current environment for running the test.
UpdatePathTestBase::setUp in core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
Overrides BrowserTestBase::setUp() for update testing.

File

core/lib/Drupal/Core/Test/TestRunnerKernel.php, line 19

Class

TestRunnerKernel
Kernel for run-tests.sh.

Namespace

Drupal\Core\Test

Code

public static function createFromRequest(Request $request, $class_loader, $environment = 'test_runner', $allow_dumping = TRUE, $app_root = NULL) {
  return parent::createFromRequest($request, $class_loader, $environment, $allow_dumping, $app_root);
}