function BuildTestBase::tearDown

Same name in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::tearDown()
  2. 8.9.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::tearDown()
  3. 11.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::tearDown()
1 call to BuildTestBase::tearDown()
ComposerHookTest::tearDown in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php
1 method overrides BuildTestBase::tearDown()
ComposerHookTest::tearDown in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 172

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

protected function tearDown() : void {
    parent::tearDown();
    $this->stopServer();
    foreach ($this->portLocks as $lock) {
        $lock->release();
    }
    $ws = $this->getWorkspaceDirectory();
    $fs = new SymfonyFilesystem();
    if ($this->destroyBuild && $fs->exists($ws)) {
        // Filter out symlinks as chmod cannot alter them.
        $finder = new Finder();
        $finder->in($ws)
            ->directories()
            ->ignoreVCS(FALSE)
            ->ignoreDotFiles(FALSE)
            ->notPath('/^vendor\\/bin\\/composer$/');
        $fs->chmod($finder->getIterator(), 0775, 00);
        $fs->remove($ws);
    }
}

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