Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292199

Remove TestBase::rebuildContainer()

$
0
0

#1708692: Simpletest slow and other problems following 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:

<?php
/**
   * 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 <a href="http://drupal.org/node/1708692" title="http://drupal.org/node/1708692" rel="nofollow">http://drupal.org/node/1708692</a> 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();
  }
?>

Viewing all articles
Browse latest Browse all 292199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>