/**
* When you create a named node, you can provide it with initial values. But
* the second time you call a node, it is not created, hence you cannot give
* it initial values.
*/
public function testSecondNamedNodeWithInitialValuesThrowsException() { /** @var AddToListConfig $configBuilder */
$configBuilder =
$this->
generateConfigBuilder(AddToList::
class);
$messenger =
$configBuilder->
messenger();
$foo =
$messenger->
routing('foo',
['senders' => 'a'
]);
$bar =
$messenger->
routing('bar',
['senders' => 'b'
]);
$this->
assertNotEquals($foo,
$bar);
$foo2 =
$messenger->
routing('foo'
);
$this->
assertEquals($foo,
$foo2);
$this->
expectException(InvalidConfigurationException::
class);
$messenger->
routing('foo',
['senders' => 'c'
]);
} /**
* Make sure you pass values that are defined.
*/