Skip to content

Commit

Permalink
Add the possibility to specify driver options in test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Aug 17, 2020
1 parent 4768496 commit ca56596
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Doctrine/Tests/TestUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

use function explode;
use function extension_loaded;
use function strlen;
use function strpos;
use function substr;
use function unlink;

/**
Expand Down Expand Up @@ -185,6 +188,14 @@ private static function mapConnectionParameters(array $configuration, string $pr
$parameters[$parameter] = $configuration[$prefix . $parameter];
}

foreach ($configuration as $param => $value) {
if (strpos($param, $prefix . 'driver_option_') !== 0) {
continue;
}

$parameters['driver_options'][substr($param, strlen($prefix . 'driver_option_'))] = $value;
}

return $parameters;
}

Expand Down

0 comments on commit ca56596

Please sign in to comment.