Skip to content
Snippets Groups Projects
Unverified Commit 868e8468 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3056698 by mondrake, quietone: Sqlite...

Issue #3056698 by mondrake, quietone: Sqlite Connection::createConnectionOptionsFromUrl should not convert relative paths to full
parent 84af9646
No related branches found
No related tags found
5 merge requests!5423Draft: Resolve #3329907 "Test2",!3478Issue #3337882: Deleted menus are not removed from content type config,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #424591 passed with warnings
Pipeline: drupal

#424594

    ......@@ -445,12 +445,7 @@ public static function createConnectionOptionsFromUrl($url, $root) {
    if ($url_components['path'][0] === '/') {
    $url_components['path'] = substr($url_components['path'], 1);
    }
    if ($url_components['path'][0] === '/' || $url_components['path'] === ':memory:') {
    $database['database'] = $url_components['path'];
    }
    else {
    $database['database'] = $root . '/' . $url_components['path'];
    }
    // User credentials and system port are irrelevant for SQLite.
    unset(
    ......
    ......@@ -40,9 +40,8 @@ public function testCreateConnectionOptionsFromUrl(string $url, string $expected
    * - Expected database connection option
    */
    public static function providerCreateConnectionOptionsFromUrl(): array {
    $root = dirname(__DIR__, 8);
    return [
    'sqlite relative path' => ['sqlite://localhost/tmp/test', $root . '/tmp/test'],
    'sqlite relative path' => ['sqlite://localhost/tmp/test', 'tmp/test'],
    'sqlite absolute path' => ['sqlite://localhost//tmp/test', '/tmp/test'],
    'in memory sqlite path' => ['sqlite://localhost/:memory:', ':memory:'],
    ];
    ......
    ......@@ -44,7 +44,6 @@ public function testDbUrlToConnectionConversion($url, $database_array, $include_
    * - database_array: An array containing the expected results.
    */
    public static function providerConvertDbUrlToConnectionInfo() {
    $root = dirname(__FILE__, 7);
    return [
    'MySql without prefix' => [
    'mysql://test_user:test_pass@test_host:3306/test_database',
    ......@@ -65,7 +64,7 @@ public static function providerConvertDbUrlToConnectionInfo() {
    [
    'driver' => 'sqlite',
    'host' => 'localhost',
    'database' => $root . '/test_database',
    'database' => 'test_database',
    'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
    'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
    ],
    ......@@ -91,7 +90,7 @@ public static function providerConvertDbUrlToConnectionInfo() {
    [
    'driver' => 'sqlite',
    'host' => 'localhost',
    'database' => $root . '/test_database',
    'database' => 'test_database',
    'prefix' => 'foo',
    'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
    'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
    ......@@ -266,7 +265,7 @@ public static function providerConvertDbUrlToConnectionInfo() {
    [
    'driver' => 'sqlite',
    'host' => 'localhost',
    'database' => $root . '/test_database',
    'database' => 'test_database',
    'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
    'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
    ],
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment