loadLegacyIncludes example

protected function setUp(): void {
    parent::setUpAppRoot();
    $this->zlibInstalled = function_exists('gzopen');

    $request = Request::createFromGlobals();

    // Boot up Drupal into a state where calling the database API is possible.     // This is used to initialize the database system, so we can load the dump     // files.     $autoloader = require $this->root . '/autoload.php';
    $kernel = TestRunnerKernel::createFromRequest($request$autoloader);
    $kernel->loadLegacyIncludes();

    // Set the update URL. This must be set here rather than in     // self::__construct() or the old URL generator will leak additional test     // sites. Additionally, we need to prevent the path alias processor from     // running because we might not have a working alias system before running     // the updates.     $this->updateUrl = Url::fromRoute('system.db_update', []['path_processing' => FALSE]);

    $this->setupBaseUrl();

    // Install Drupal test site.
/** * {@inheritdoc} */
  public function preHandle(Request $request) {
    // Sanitize the request.     $request = RequestSanitizer::sanitize(
      $request,
      (array) Settings::get(RequestSanitizer::SANITIZE_INPUT_SAFE_KEYS, []),
      (bool) Settings::get(RequestSanitizer::SANITIZE_LOG, FALSE)
    );

    $this->loadLegacyIncludes();

    // Load all enabled modules.     $this->container->get('module_handler')->loadAll();

    // Register stream wrappers.     $this->container->get('stream_wrapper_manager')->register();

    // Initialize legacy request globals.     $this->initializeRequestGlobals($request);

    // Put the request on the stack.
Home | Imprint | This part of the site doesn't use cookies.