File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ CHANGELOG
17
17
* Added ` debug:container --deprecations ` option to see compile-time deprecations.
18
18
* Made ` BrowserKitAssertionsTrait ` report the original error message in case of a failure
19
19
* Added ability for ` config:dump-reference ` and ` debug:config ` to dump and debug kernel container extension configuration.
20
+ * Deprecated ` session.attribute_bag ` service and ` session.flash_bag ` service.
20
21
21
22
5.0.0
22
23
-----
Original file line number Diff line number Diff line change 43
43
44
44
<service id =" session.flash_bag" class =" Symfony\Component\HttpFoundation\Session\Flash\FlashBag" >
45
45
<factory service =" session" method =" getFlashBag" />
46
+ <deprecated package =" symfony/framework-bundle" version =" 5.1" >The "%service_id%" service is deprecated, use "$session->getFlashBag()" instead.</deprecated >
46
47
</service >
47
48
<service id =" Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface" alias =" session.flash_bag" />
48
49
49
50
<service id =" session.attribute_bag" class =" Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag" >
50
51
<factory service =" session" method =" getAttributeBag" />
52
+ <deprecated package =" symfony/framework-bundle" version =" 5.1" >The "%service_id%" service is deprecated, use "$session->getAttributeBag()" instead.</deprecated >
51
53
</service >
52
54
53
55
<service id =" session.storage.mock_file" class =" Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage" >
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bundle \FrameworkBundle \Tests \Functional ;
13
13
14
+ use Symfony \Bridge \PhpUnit \ExpectDeprecationTrait ;
15
+
14
16
class SessionTest extends AbstractWebTestCase
15
17
{
18
+ use ExpectDeprecationTrait;
19
+
16
20
/**
17
21
* Tests session attributes persist.
18
22
*
@@ -72,10 +76,13 @@ public function testFlash($config, $insulate)
72
76
/**
73
77
* Tests flash messages work when flashbag service is injected to the constructor.
74
78
*
79
+ * @group legacy
75
80
* @dataProvider getConfigs
76
81
*/
77
82
public function testFlashOnInjectedFlashbag ($ config , $ insulate )
78
83
{
84
+ $ this ->expectDeprecation ('Since symfony/framework-bundle 5.1: The "session.flash_bag" service is deprecated, use "$session->getFlashBag()" instead. ' );
85
+
79
86
$ client = $ this ->createClient (['test_case ' => 'Session ' , 'root_config ' => $ config ]);
80
87
if ($ insulate ) {
81
88
$ client ->insulate ();
You can’t perform that action at this time.
0 commit comments