You are here

public function Fixtures::tearDown in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::tearDown()
  2. 9 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=');
}