public function ConnectionTest::testCreateConnectionOptionsFromUrl in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php \Drupal\Tests\Core\Database\Driver\sqlite\ConnectionTest::testCreateConnectionOptionsFromUrl()
- 9 core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php \Drupal\Tests\Core\Database\Driver\sqlite\ConnectionTest::testCreateConnectionOptionsFromUrl()
@covers ::createConnectionOptionsFromUrl @dataProvider providerCreateConnectionOptionsFromUrl
Parameters
string $url: SQLite URL.
string $expected: Expected connection option.
File
- core/
tests/ Drupal/ Tests/ Core/ Database/ Driver/ sqlite/ ConnectionTest.php, line 24
Class
- ConnectionTest
- @coversDefaultClass \Drupal\sqlite\Driver\Database\sqlite\Connection @group Database
Namespace
Drupal\Tests\Core\Database\Driver\sqliteCode
public function testCreateConnectionOptionsFromUrl(string $url, string $expected) {
$root = dirname(__DIR__, 8);
$sqlite_connection = new Connection($this
->createMock(StubPDO::class), []);
$database = $sqlite_connection
->createConnectionOptionsFromUrl($url, $root);
$this
->assertEquals('sqlite', $database['driver']);
$this
->assertEquals($expected, $database['database']);
}