function TestDatabase::getLockFile

Same name in other branches
  1. 9 core/lib/Drupal/Core/Test/TestDatabase.php \Drupal\Core\Test\TestDatabase::getLockFile()
  2. 8.9.x core/lib/Drupal/Core/Test/TestDatabase.php \Drupal\Core\Test\TestDatabase::getLockFile()
  3. 10 core/lib/Drupal/Core/Test/TestDatabase.php \Drupal\Core\Test\TestDatabase::getLockFile()

Gets the lock file path.

Parameters

int $lock_id: The test method lock ID.

Return value

string A file path to the symbolic link that prevents the lock ID being re-used.

2 calls to TestDatabase::getLockFile()
TestDatabase::getTestLock in core/lib/Drupal/Core/Test/TestDatabase.php
Generates a unique lock ID for the test method.
TestDatabase::releaseLock in core/lib/Drupal/Core/Test/TestDatabase.php
Releases a lock.

File

core/lib/Drupal/Core/Test/TestDatabase.php, line 147

Class

TestDatabase
Provides helper methods for interacting with the fixture database.

Namespace

Drupal\Core\Test

Code

protected function getLockFile(int $lock_id) : string {
    return FileSystem::getOsTemporaryDirectory() . '/test_' . $lock_id;
}

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