diff --git a/core/tests/Drupal/FunctionalTests/BrowserTest/StandardProfileTest.php b/core/tests/Drupal/FunctionalTests/BrowserTest/StandardProfileTest.php index d116aec..ea25e16 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTest/StandardProfileTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTest/StandardProfileTest.php @@ -20,7 +20,7 @@ class StandardProfileTest extends BrowserTestBase { * Empty test method because we only want to make sure that the set up works. */ public function testStandardProfile() { - + $this->assertTrue(TRUE); } } diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index a8700b4..4c66a70 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -274,6 +274,13 @@ protected $baseUrl; /** + * The original array of shutdown function callbacks. + * + * @var array + */ + protected $originalShutdownCallbacks = []; + + /** * Initializes Mink sessions. */ protected function initMink() { @@ -505,6 +512,10 @@ protected function tearDown() { if ($this->mink) { $this->mink->stopSessions(); } + + // Restore original shutdown callbacks. + $callbacks = &drupal_register_shutdown_function(); + $callbacks = $this->originalShutdownCallbacks; } /** @@ -1241,6 +1252,14 @@ protected function prepareEnvironment() { )); drupal_set_time_limit($this->timeLimit); + + // Save and clean the shutdown callbacks array because it is static cached + // and will be changed by the test run. Otherwise it will contain callbacks + // from both environments and the testing environment will try to call the + // handlers defined by the original one. + $callbacks = &drupal_register_shutdown_function(); + $this->originalShutdownCallbacks = $callbacks; + $callbacks = []; } /**