public function testRemoveWithDeprecation() { $bag =
new ParameterBag([ 'foo' => 'foo',
'bar' => 'bar',
]);
$bag->
deprecate('foo', 'symfony/test', '6.3'
);
$bag->
remove('foo'
);
$this->
assertEquals(['bar' => 'bar'
],
$bag->
all(), '->remove() removes a parameter'
);
$this->
assertEquals([],
$bag->
allDeprecated());
} public function testGetSet() { $bag =
new ParameterBag(['foo' => 'bar'
]);
$bag->
set('bar', 'foo'
);
$this->
assertEquals('foo',
$bag->
get('bar'
), '->set() sets the value of a new parameter'
);
$bag->
set('foo', 'baz'
);
$this->
assertEquals('baz',
$bag->
get('foo'
), '->set() overrides previously set parameter'
);