function SandboxManagerBaseTest::testGetSandboxDirectoryWithoutLock

Same name and namespace in other branches
  1. main core/modules/package_manager/tests/src/Kernel/SandboxManagerBaseTest.php \Drupal\Tests\package_manager\Kernel\SandboxManagerBaseTest::testGetSandboxDirectoryWithoutLock()

Tests that getSandboxDirectory() works without a lock.

The sandbox directory path should be deterministic and accessible without creating or claiming the stage, since other components (CronHook, LongLivedSandboxSubscriber) need to check the path for cleanup decisions.

@legacy-covers ::getSandboxDirectory

File

core/modules/package_manager/tests/src/Kernel/SandboxManagerBaseTest.php, line 548

Class

SandboxManagerBaseTest
Tests Drupal\package_manager\SandboxManagerBase.

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testGetSandboxDirectoryWithoutLock() : void {
  $stage = $this->createStage();
  // getSandboxDirectory() should work without creating/claiming the stage.
  $dir = $stage->getSandboxDirectory();
  $this->assertStringEndsWith('/sandbox_directory', $dir);
  // The returned path should be consistent.
  $this->assertSame($dir, $stage->getSandboxDirectory());
}

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