Skip to content

Commit

Permalink
Fix precendence in 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Jun 13, 2020
1 parent 055dd28 commit 992205a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function buildConfigurationProvider(): iterable
'expectedAutoSetup' => false,
];

yield 'options from options array wins over options from dsn' => [
yield 'options from dsn array wins over options from options' => [
'dsn' => 'doctrine://default?table_name=name_from_dsn&redeliver_timeout=1200&queue_name=normal&auto_setup=true',
'options' => [
'table_name' => 'name_from_options',
Expand All @@ -218,10 +218,10 @@ public function buildConfigurationProvider(): iterable
'auto_setup' => false,
],
'expectedConnection' => 'default',
'expectedTableName' => 'name_from_options',
'expectedRedeliverTimeout' => 1800,
'expectedQueue' => 'important',
'expectedAutoSetup' => false,
'expectedTableName' => 'name_from_dsn',
'expectedRedeliverTimeout' => 1200,
'expectedQueue' => 'normal',
'expectedAutoSetup' => true,
];

yield 'options from dsn with falsey boolean' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function buildConfiguration(string $dsn, array $options = []): arr
}

$configuration = ['connection' => $components['host']];
$configuration += $options + $query + self::DEFAULT_OPTIONS;
$configuration += $query + $options + self::DEFAULT_OPTIONS;

$configuration['auto_setup'] = filter_var($configuration['auto_setup'], FILTER_VALIDATE_BOOLEAN);

Expand Down

0 comments on commit 992205a

Please sign in to comment.