Skip to content

Commit c0ed5f9

Browse files
committed
Fix merging driver options in the pdo_sqlsrv driver test
array_replace() preserves numeric keys in the case if both string string keys designated for the DSN and numeric keys designated for PDO are present.
1 parent bb49ca4 commit c0ed5f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Functional/Driver/PDO/SQLSrv/DriverTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
1414

1515
use function array_merge;
16+
use function array_replace;
1617

1718
#[RequiresPhpExtension('pdo_sqlsrv')]
1819
class DriverTest extends AbstractDriverTestCase
@@ -44,7 +45,7 @@ private function getConnection(array $driverOptions): Connection
4445
$params = TestUtil::getConnectionParams();
4546

4647
if (isset($params['driverOptions'])) {
47-
$driverOptions = array_merge($params['driverOptions'], $driverOptions);
48+
$driverOptions = array_replace($params['driverOptions'], $driverOptions);
4849
}
4950

5051
return (new Driver())->connect(

0 commit comments

Comments
 (0)