Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestDatabase.php

function TestDatabase::releaseAllTestLocks

Releases all test locks.

This should only be called once all the test fixtures have been cleaned up.

File

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

Class

TestDatabase
Provides helper methods for interacting with the fixture database.

Namespace

Drupal\Core\Test

Code

public static function releaseAllTestLocks() : void {
    $tmp = FileSystem::getOsTemporaryDirectory();
    $dir = dir($tmp);
    while (($entry = $dir->read()) !== FALSE) {
        if ($entry === '.' || $entry === '..') {
            continue;
        }
        $entry_path = $tmp . '/' . $entry;
        if (preg_match('/^test_\\d+/', $entry) && is_link($entry_path)) {
            unlink($entry_path);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal