#1708692: Bundle services aren't available in the request that enables the module was committed in August 2012 with just a followup remaining to be discussed.
So we should be able to safely remove TestBase::rebuildContainer() now:
/**
* Rebuild drupal_container().
*
* Use this to build a new kernel and service container. For example, when the
* list of enabled modules is changed via the internal browser, in which case
* the test process still contains an old kernel and service container with an
* old module list.
*
* @todo Fix http://drupal.org/node/1708692 so that module enable/disable
* changes are immediately reflected in drupal_container(). Until then,
* tests can invoke this workaround when requiring services from newly
* enabled modules to be immediately available in the same request.
*
* @see TestBase::prepareEnvironment()
* @see TestBase::tearDown()
*/
protected function rebuildContainer() {
$this->kernel = new DrupalKernel('testing', drupal_classloader(), FALSE);
$this->kernel->boot();
// DrupalKernel replaces the container in drupal_container() with a
// different object, so we need to replace the instance on this test class.
$this->container = drupal_container();
}
Comments
Comment #1
panchoLet's start with this patch, replacing the function with an empty stub.
I'm getting quite many fails, though.
So are module enable/disable changes now immediately reflected in drupal_container(), or is something missing?
Comment #2
panchoComment #10
dawehnerThis method no longer exists. Given that I think we can close this issue.
Comment #12
tim.plunkett