Merge pull request #8656 from kenjis/add-comments-to-PDO_PGSQL-DSN

docs: add commnets on Postgre::convertDSN()
This commit is contained in:
kenjis 2024-03-29 07:42:23 +09:00 committed by GitHub
commit 87652c92c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,9 @@ class Connection extends BaseConnection
}
// Convert DSN string
// @TODO This format is for PDO_PGSQL.
// https://www.php.net/manual/en/ref.pdo-pgsql.connection.php
// Should deprecate?
if (mb_strpos($this->DSN, 'pgsql:') === 0) {
$this->convertDSN();
}

View File

@ -198,6 +198,9 @@ final class ConfigTest extends CIUnitTestCase
*/
public function testConvertDSN(string $input, string $expected): void
{
// @TODO This format is for PDO_PGSQL.
// https://www.php.net/manual/en/ref.pdo-pgsql.connection.php
// Should deprecate?
$this->dsnGroupPostgreNative['DSN'] = $input;
$conn = Config::connect($this->dsnGroupPostgreNative, false);
$this->assertInstanceOf(BaseConnection::class, $conn);