10000 bug #37268 [Messenger] Fix precedence of DSN options for 4.4 (jderusse) · symfony/symfony@453c3a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 453c3a7

Browse files
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 | #37218 (comment) | 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 ------- 992205a Fix precendence in 4.4
2 parents a6e3789 + 992205a commit 453c3a7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function buildConfigurationProvider(): iterable
209209
'expectedAutoSetup' => false,
210210
];
211211

212-
yield 'options from options array wins over options from dsn' => [
212+
yield 'options from dsn array wins over options from options' => [
213213
'dsn' => 'doctrine://default?table_name=name_from_dsn&redeliver_timeout=1200&queue_name=normal&auto_setup=true',
214214
'options' => [
215215
'table_name' => 'name_from_options',
@@ -218,10 +218,10 @@ public function buildConfigurationProvider(): iterable
218218
'auto_setup' => false,
219219
],
220220
'expectedConnection' => 'default',
221-
'expectedTableName' => 'name_from_options',
222-
'expectedRedeliverTimeout' => 1800,
223-
'expectedQueue' => 'important',
224-
'expectedAutoSetup' => false,
221+
'expectedTableName' => 'name_from_dsn',
222+
'expectedRedeliverTimeout' => 1200,
223+
'expectedQueue' => 'normal',
224+
'expectedAutoSetup' => true,
225225
];
226226

227227
yield 'options from dsn with falsey boolean' => [

src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static function buildConfiguration(string $dsn, array $options = []): arr
8585
}
8686

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

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

0 commit comments

Comments
 (0)
0