class Fixtures

Same name in this branch
  1. 11.x core/tests/Drupal/Tests/Composer/Generator/Fixtures.php \Drupal\Tests\Composer\Generator\Fixtures
  2. 11.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures
Same name in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Generator/Fixtures.php \Drupal\Tests\Composer\Generator\Fixtures
  2. 9 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures
  3. 8.9.x core/tests/Drupal/Tests/Composer/Generator/Fixtures.php \Drupal\Tests\Composer\Generator\Fixtures
  4. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures
  5. 10 core/tests/Drupal/Tests/Composer/Generator/Fixtures.php \Drupal\Tests\Composer\Generator\Fixtures
  6. 10 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php \Drupal\Tests\Composer\Plugin\Scaffold\Fixtures

Fixture for testing the unpack composer plugin.

Hierarchy

  • class \Drupal\Tests\Composer\Plugin\FixturesBase
    • class \Drupal\Tests\Composer\Plugin\Unpack\Fixtures extends \Drupal\Tests\Composer\Plugin\FixturesBase

Expanded class hierarchy of Fixtures

1 file declares its use of Fixtures
UnpackRecipeTest.php in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
4 string references to 'Fixtures'
FileCacheTest::testDelete in core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
@covers ::delete
FileCacheTest::testGet in core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
@covers ::get @covers ::__construct
FileCacheTest::testGetMultiple in core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
@covers ::getMultiple
FileCacheTest::testSet in core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
@covers ::set

File

core/tests/Drupal/Tests/Composer/Plugin/Unpack/Fixtures.php, line 12

Namespace

Drupal\Tests\Composer\Plugin\Unpack
View source
class Fixtures extends FixturesBase {
    
    /**
     * {@inheritdoc}
     */
    public function projectRoot() : string {
        return realpath(__DIR__) . '/../../../../../../../composer/Plugin/RecipeUnpack';
    }
    
    /**
     * {@inheritdoc}
     */
    public function allFixturesDir() : string {
        return realpath(__DIR__ . '/fixtures');
    }
    
    /**
     * {@inheritdoc}
     */
    public function tmpDir(string $prefix) : string {
        $prefix .= static::persistentPrefix();
        $tmpDir = sys_get_temp_dir() . '/unpack-' . $prefix . uniqid(md5($prefix . microtime()), TRUE);
        $this->tmpDirs[] = $tmpDir;
        return $tmpDir;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
Fixtures::allFixturesDir public function Gets the path to the project fixtures. Overrides FixturesBase::allFixturesDir
Fixtures::projectRoot public function Gets the path to Scaffold component. Overrides FixturesBase::projectRoot
Fixtures::tmpDir public function Generates a path to a temporary location, but do not create the directory. Overrides FixturesBase::tmpDir
FixturesBase::$composer protected property The composer object.
FixturesBase::$io protected property A Composer IOInterface to write to.
FixturesBase::$randomPrefix protected static property Keep a persistent prefix to help group our tmp directories together.
FixturesBase::$tmpDirs protected property Directories to delete when we are done.
FixturesBase::binFixtureDir public function Gets the path to one particular bin path.
FixturesBase::cloneFixtureProjects public function Creates a temporary copy of all of the fixtures projects into a temp dir.
FixturesBase::createIsolatedComposerCacheDir public function Creates an isolated cache directory for Composer.
FixturesBase::getComposer public function Gets the Composer object.
FixturesBase::getOutput public function Gets the output from the io() fixture.
FixturesBase::io public function Gets an IO fixture.
FixturesBase::mkTmpDir public function Creates a temporary directory.
FixturesBase::persistentPrefix protected static function Generates a persistent prefix to use with all of our temporary directories.
FixturesBase::projectFixtureDir public function Gets the path to one particular project fixture.
FixturesBase::runComposer public function Runs a `composer` command.
FixturesBase::tearDown public function Calls 'tearDown' in any test that copies fixtures to transient locations.

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