function SymlinkValidatorTest::testAbsoluteSymlinks

Tests that symlinks with absolute paths are not supported.

File

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

Class

SymlinkValidatorTest
@covers \Drupal\package_manager\Validator\SymlinkValidator @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([
        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.