/** * Cleans up after testing. * * Deletes created files and temporary files directory, deletes the tables * created by setUp(), and resets the database prefix. */ protected function tearDown() { // Destroy the testing kernel. if (isset($this->kernel)) { $this->kernel->shutdown(); } parent::tearDown(); // Ensure that the maximum meta refresh count is reset. $this->maximumMetaRefreshCount = NULL; // Ensure that internal logged in variable and cURL options are reset. $this->loggedInUser = FALSE; $this->additionalCurlOptions = array(); // Close the CURL handler and reset the cookies array used for upgrade // testing so test classes containing multiple tests are not polluted. $this->curlClose(); $this->curlCookies = array(); $this->cookies = array(); }
/** * {@inheritdoc} */ protected function tearDown() { if ($this->kernel instanceof DrupalKernel) { $this->kernel->shutdown(); } // Before tearing down the test environment, ensure that no stream wrapper // of this test leaks into the parent environment. Unlike all other global // state variables in Drupal, stream wrappers are a global state construct // of PHP core, which has to be maintained manually. // @todo Move StreamWrapper management into DrupalKernel. // @see https://www.drupal.org/node/2028109 foreach ($this->streamWrappers as $scheme => $type) { $this->unregisterStreamWrapper($scheme, $type); } parent::tearDown(); }