-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(PgSQL): Allow to pass IPv6 address in URI notation for postgres
Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Tests\Driver\PgSQL; | ||
|
||
use Doctrine\DBAL\Driver as DriverInterface; | ||
use Doctrine\DBAL\Driver\PgSQL\Driver; | ||
use Doctrine\DBAL\Tests\Driver\AbstractPostgreSQLDriverTestCase; | ||
use Doctrine\DBAL\Tests\TestUtil; | ||
use PHPUnit\Framework\Attributes\RequiresPhpExtension; | ||
|
||
class DriverTest extends AbstractPostgreSQLDriverTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
if (isset($GLOBALS['db_driver']) && $GLOBALS['db_driver'] === 'pgsql') { | ||
return; | ||
} | ||
|
||
self::markTestSkipped('Test enabled only when using pgsql specific phpunit.xml'); | ||
} | ||
|
||
/** | ||
* Ensure we can handle URI notation for IPv6 addresses | ||
*/ | ||
#[RequiresPhpExtension('pgsql')] | ||
public function testConnectionIPv6(): void | ||
{ | ||
self::expectNotToPerformAssertions(); | ||
|
||
$params = TestUtil::getConnectionParams(); | ||
$params['host'] = '[::1]'; | ||
|
||
$this->driver->connect($params); | ||
} | ||
|
||
protected function createDriver(): DriverInterface | ||
{ | ||
return new Driver(); | ||
} | ||
} |