Skip to content

Commit

Permalink
Fixed PHP Notice: Undefined index: $GLOBALS['base_url'].
Browse files Browse the repository at this point in the history
  • Loading branch information
sun committed Jul 24, 2014
1 parent cc8c9fb commit e5c29c0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/tests/Drupal/Tests/KernelTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ protected function setUp() {
elseif ($modules && $extensions = $this->getExtensionsForModules($modules)) {
$kernel->updateModules($extensions, $extensions);
}
$kernel->boot();
// DrupalKernel::boot() is not sufficient as it does not invoke
// DrupalKernel::preHandle(), which initializes legacy global variables.
$request = Request::create('/');
$kernel->prepareLegacyRequest($request);

// register() is only called if a new container was built/compiled.
$this->container = $kernel->getContainer();
Expand All @@ -261,10 +264,6 @@ protected function setUp() {
$this->container->get('module_handler')->loadAll();
}

// Add a master request to the stack.
$request = Request::create('/');
$this->container->get('request_stack')->push($request);

$this->container->set('test.logger', $this);

// Create a minimal core.extension configuration object so that the list of
Expand Down

0 comments on commit e5c29c0

Please sign in to comment.