You are here

protected function UpdateTestBase::getPackagePath in Automatic Updates 8.2

File

tests/src/Build/UpdateTestBase.php, line 58

Class

UpdateTestBase
Base class for tests that perform in-place updates.

Namespace

Drupal\Tests\automatic_updates\Build

Code

protected function getPackagePath(array $package) : string {
  if ($package['name'] === 'drupal/core') {
    return 'core';
  }
  [
    $vendor,
    $name,
  ] = explode('/', $package['name']);

  // Assume any contributed module is in modules/contrib/$name.
  if ($vendor === 'drupal' && $package['type'] === 'drupal-module') {
    return implode(DIRECTORY_SEPARATOR, [
      'modules',
      'contrib',
      $name,
    ]);
  }
  return $this
    ->traitGetPackagePath($package);
}