function ShutdownFunctionsTest::tearDown

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php \Drupal\Tests\system\Functional\System\ShutdownFunctionsTest::tearDown()
  2. 8.9.x core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php \Drupal\Tests\system\Functional\System\ShutdownFunctionsTest::tearDown()
  3. 10 core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php \Drupal\Tests\system\Functional\System\ShutdownFunctionsTest::tearDown()

Overrides BrowserTestBase::tearDown

File

core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php, line 29

Class

ShutdownFunctionsTest
Functional tests shutdown functions.

Namespace

Drupal\Tests\system\Functional\System

Code

protected function tearDown() : void {
    // This test intentionally throws an exception in a PHP shutdown function.
    // Prevent it from being interpreted as an actual test failure.
    // Not using File API; a potential error must trigger a PHP warning.
    unlink(\Drupal::root() . '/' . $this->siteDirectory . '/error.log');
    parent::tearDown();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.