You are here

protected static function EndOfTransactionQueriesTest::statementToTableName in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php \Drupal\KernelTests\Core\Cache\EndOfTransactionQueriesTest::statementToTableName()
  2. 9 core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php \Drupal\KernelTests\Core\Cache\EndOfTransactionQueriesTest::statementToTableName()

Returns the table name for a statement.

Parameters

string $statement: The query statement.

Return value

string|null The name of the table or NULL if none was found.

File

core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php, line 166

Class

EndOfTransactionQueriesTest
Tests that cache tag invalidation queries are delayed to the end of transactions.

Namespace

Drupal\KernelTests\Core\Cache

Code

protected static function statementToTableName($statement) {
  if (preg_match('/.*\\{([^\\}]+)\\}.*/', $statement, $matches)) {
    return $matches[1];
  }
  else {
    return NULL;
  }
}