Skip to content

Commit

Permalink
OPENEUROPA-1873: Fixing the installation of the User module in the Ke…
Browse files Browse the repository at this point in the history
…rnel test.
  • Loading branch information
upchuk committed May 2, 2019
1 parent af1c71c commit a9977b2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Kernel/AbstractKernelTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ protected function setUp() {
$this->container->get('theme_installer')->install(['oe_theme']);
$this->container->get('theme_handler')->setDefault('oe_theme');
$this->container->set('theme.registry', NULL);

// Call the install hook of the User module which creates the Anonymous user
// and User 1. This is needed because the Anonymous user is loaded to
// provide the current User context which is needed in places like route
// enhancers.
// @see CurrentUserContext::getRuntimeContexts().
// @see EntityConverter::convert().
module_load_include('install', 'user');
user_install();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions tests/Kernel/BreadcrumbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ protected function setUp() {
$this->container->get('theme_installer')->install(['oe_theme']);
$this->container->get('theme_handler')->setDefault('oe_theme');
$this->container->set('theme.registry', NULL);

// Call the install hook of the User module which creates the Anonymous user
// and User 1. This is needed because the Anonymous user is loaded to
// provide the current User context which is needed in places like route
// enhancers.
// @see CurrentUserContext::getRuntimeContexts().
// @see EntityConverter::convert().
module_load_include('install', 'user');
user_install();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions tests/Kernel/MultilingualAbstractKernelTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ protected function setUp() {
// Rebuild the container in order to make sure tests pass.
// @todo: fix test setup so that we can get rid of this line.
$this->container->get('kernel')->rebuildContainer();

// Call the install hook of the User module which creates the Anonymous user
// and User 1. This is needed because the Anonymous user is loaded to
// provide the current User context which is needed in places like route
// enhancers.
// @see CurrentUserContext::getRuntimeContexts().
// @see EntityConverter::convert().
module_load_include('install', 'user');
user_install();
}

}

0 comments on commit a9977b2

Please sign in to comment.