You are here

public function ConnectionTest::providerCreateConnectionOptionsFromUrl in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php \Drupal\Tests\Core\Database\Driver\sqlite\ConnectionTest::providerCreateConnectionOptionsFromUrl()
  2. 9 core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php \Drupal\Tests\Core\Database\Driver\sqlite\ConnectionTest::providerCreateConnectionOptionsFromUrl()

Data provider for testCreateConnectionOptionsFromUrl.

Return value

string[][] Associative array of arrays with the following elements:

  • SQLite database URL
  • Expected database connection option

File

core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php, line 40

Class

ConnectionTest
@coversDefaultClass \Drupal\sqlite\Driver\Database\sqlite\Connection @group Database

Namespace

Drupal\Tests\Core\Database\Driver\sqlite

Code

public function providerCreateConnectionOptionsFromUrl() : array {
  $root = dirname(__DIR__, 8);
  return [
    'sqlite relative path' => [
      'sqlite://localhost/tmp/test',
      $root . '/tmp/test',
    ],
    'sqlite absolute path' => [
      'sqlite://localhost//tmp/test',
      '/tmp/test',
    ],
    'in memory sqlite path' => [
      'sqlite://localhost/:memory:',
      ':memory:',
    ],
  ];
}