Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3791db5

Browse filesBrowse files
committed
[Messenger] Messenger options were merged with numbers as keys.
Test for merging values written in relevant Tests directory.
1 parent a2c696f commit 3791db5
Copy full SHA for 3791db5

File tree

2 files changed

+52
-56
lines changed
Filter options

2 files changed

+52
-56
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
-56Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -278,62 +278,6 @@ public function testLockMergeConfigs()
278278
);
279279
}
280280

281-
public function testMessengerMergeConfigsTransportOptions()
282-
{
283-
$processor = new Processor();
284-
$configuration = new Configuration(true);
285-
$config = $processor->processConfiguration($configuration, [
286-
[
287-
'messenger' => [
288-
'transports' => [
289-
'async' => [
290-
'dsn' => 'foo',
291-
'options' => [
292-
'auto_setup' => true,
293-
'option' => 'foo',
294-
],
295-
],
296-
],
297-
],
298-
],
299-
[
300-
'messenger' => [
301-
'transports' => [
302-
'async' => [
303-
'options' => [
304-
'wait_time' => 20,
305-
'option' => 'bar',
306-
'queue' => [
307-
'name' => 'Queue',
308-
'option' => 'foo',
309-
'queue_options' => [
310-
'option' => 'foo',
311-
],
312-
],
313-
],
314-
],
315-
],
316-
],
317-
],
318-
]);
319-
320-
$this->assertSame(
321-
[
322-
'auto_setup' => true,
323-
'option' => 'bar',
324-
'wait_time' => 20,
325-
'queue' => [
326-
'name' => 'Queue',
327-
'option' => 'foo',
328-
'queue_options' => [
329-
'option' => 'foo',
330-
],
331-
],
332-
],
333-
$config['messenger']['transports']['async']['options']
334-
);
335-
}
336-
337281
public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefaultBus()
338282
{
339283
$expectedMessage = 'You must specify the "default_bus" if you define more than one bus.';

‎src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php
+52Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,56 @@ public function getDataForKeyRemovedLeftValueOnly()
338338
],
339339
];
340340
}
341+
342+
/**
343+
* @dataProvider getPrototypedArrayNodeDataToMerge
344+
*/
345+
public function testPrototypedArrayNodeMerge($left, $right, $expected)
346+
{
347+
$node = new PrototypedArrayNode('options');
348+
$node->setNormalizeKeys(false);
349+
$node->setPrototype(new VariableNode('value'));
350+
$node->setDefaultValue([]);
351+
352+
$result = $node->merge($left, $right);
353+
354+
self::assertSame($result, $expected);
355+
}
356+
357+
public function getPrototypedArrayNodeDataToMerge()
358+
{
359+
return [
360+
// data to merged is a plain array
361+
[
362+
['foo', 'bar'],
363+
['foo', 'baz', 'qux'],
364+
['foo', 'bar', 'foo', 'baz', 'qux'],
365+
],
366+
// data to be merged is an associative array
367+
[
368+
['option1' => true, 'option2' => 'foo',],
369+
[
370+
'option2' => 'bar',
371+
'option3' => 42,
372+
'option4' => [
373+
'option41' => 'baz',
374+
'option42' => [
375+
'option423' => 'qux',
376+
],
377+
],
378+
],
379+
[
380+
'option1' => true,
381+
'option2' => 'bar',
382+
'option3' => 42,
383+
'option4' => [
384+
'option41' => 'baz',
385+
'option42' => [
386+
'option423' => 'qux',
387+
],
388+
],
389+
],
390+
],
391+
];
392+
}
341393
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.