You are here

public static function TestSetupTrait::getDatabaseConnection in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/TestSetupTrait.php \Drupal\Core\Test\TestSetupTrait::getDatabaseConnection()
  2. 9 core/lib/Drupal/Core/Test/TestSetupTrait.php \Drupal\Core\Test\TestSetupTrait::getDatabaseConnection()

Returns the database connection to the site under test.

Return value

\Drupal\Core\Database\Connection The database connection to use for inserting assertions.

1 call to TestSetupTrait::getDatabaseConnection()
StatusTest::testStatusPage in core/modules/system/tests/src/Functional/System/StatusTest.php
Tests that the status page returns.

File

core/lib/Drupal/Core/Test/TestSetupTrait.php, line 109

Class

TestSetupTrait
Provides a trait for shared test setup functionality.

Namespace

Drupal\Core\Test

Code

public static function getDatabaseConnection() {
  return TestDatabase::getConnection();
}