bug #37268 [Messenger] Fix precedence of DSN options for 4.4 (jderusse)
This PR was merged into the 4.4 branch.
Discussion
----------
[Messenger] Fix precedence of DSN options for 4.4
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/pull/37218#discussion_r438779225
| License | MIT
| Doc PR | N/A
This PR fix précédence of DSN options over constructor options in all component on branch 4.4
Commits
-------
992205a759
Fix precendence in 4.4
This commit is contained in:
commit
453c3a7187
@ -209,7 +209,7 @@ class ConnectionTest extends TestCase
|
||||
'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',
|
||||
@ -218,10 +218,10 @@ class ConnectionTest extends TestCase
|
||||
'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' => [
|
||||
|
@ -85,7 +85,7 @@ class Connection
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
|
Reference in New Issue
Block a user