function SymlinkValidatorTest::testAbsoluteSymlinks

Tests that symlinks with absolute paths are not supported.

File

core/modules/package_manager/tests/src/Kernel/SymlinkValidatorTest.php, line 66

Class

SymlinkValidatorTest
@covers \Drupal\package_manager\Validator\SymlinkValidator[[api-linebreak]] @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testAbsoluteSymlinks() : void {
  $project_root = $this->container
    ->get(PathLocator::class)
    ->getProjectRoot();
  symlink($project_root . '/composer.json', $project_root . '/composer.link');
  $result = ValidationResult::createError([
    $this->t('The %which directory at %dir contains absolute links, which is not supported. The first one is %file.', [
      '%which' => 'active',
      '%dir' => $project_root,
      '%file' => $project_root . '/composer.link',
    ]),
  ]);
  $this->assertStatusCheckResults([
    $result,
  ]);
}

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