Skip to content

Commit fcb85cd

Browse files
committed
improve tests
1 parent 5b8f811 commit fcb85cd

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_deprecated_parameters.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
$container = new ContainerBuilder();
66
$container->setParameter('foo_class', 'FooClass\\Foo');
77
$container->deprecateParameter('foo_class', 'symfony/test', '6.3');
8-
$container
9-
->register('foo', '%foo_class%')
8+
$container->register('foo', '%foo_class%')
109
->setPublic(true)
1110
;
1211

src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ public function testDeprecate()
143143
$bag->get('foo');
144144
}
145145

146+
/**
147+
* The test should be kept in the group as it always expects a deprecation.
148+
*
149+
* @group legacy
150+
*/
151+
public function testDeprecateWithMessage()
152+
{
153+
$bag = new ParameterBag(['foo' => 'bar']);
154+
155+
$bag->deprecate('foo', 'symfony/test', '6.3', 'The parameter "%s" is deprecated, use "new_foo" instead.');
156+
157+
$this->expectDeprecation('Since symfony/test 6.3: The parameter "foo" is deprecated, use "new_foo" instead.');
158+
159+
$bag->get('foo');
160+
}
161+
146162
/**
147163
* The test should be kept in the group as it always expects a deprecation.
148164
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy