function Fixtures::tearDown

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tearDown()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tearDown()
  3. 11.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tearDown()

Calls 'tearDown' in any test that copies fixtures to transient locations.

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php, line 304

Class

Fixtures
Convenience class for creating fixtures.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold

Code

public function tearDown() {
    // Remove any temporary directories that were created.
    $filesystem = new Filesystem();
    foreach ($this->tmpDirs as $dir) {
        $filesystem->remove($dir);
    }
    // Clear out variables from the previous pass.
    $this->tmpDirs = [];
    $this->io = NULL;
    // Clear the composer cache dir, if it was set
    putenv('COMPOSER_CACHE_DIR=');
}

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