File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,11 @@ access to other services.)
189
189
* Added an option ` always_vary_on_context_hash ` to make it possible to disable
190
190
automatically setting the vary headers for the user hash.
191
191
192
+ 1.3.16
193
+ ------
194
+
195
+ * Adjust session_listener to work with Symfony 3.4.12 (https://github.com/symfony/symfony/pull/27467 ).
196
+
192
197
1.3.15
193
198
------
194
199
Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
15
15
use Symfony \Component \HttpKernel \Event \FilterResponseEvent ;
16
+ use Symfony \Component \HttpKernel \Event \FinishRequestEvent ;
16
17
use Symfony \Component \HttpKernel \Event \GetResponseEvent ;
17
18
use Symfony \Component \HttpKernel \EventListener \SessionListener as BaseSessionListener ;
18
19
@@ -81,7 +82,13 @@ public function onKernelResponse(FilterResponseEvent $event)
81
82
// noop, see class description
82
83
}
83
84
84
- public static function getSubscribedEvents (): array
85
+ public function onFinishRequest (FinishRequestEvent $ event )
86
+ {
87
+ // this hook has been added in symfony 3.4.12 - older versions of the listener do not register for it
88
+ $ this ->inner ->onFinishRequest ($ event );
89
+ }
90
+
91
+ public static function getSubscribedEvents ()
85
92
{
86
93
return BaseSessionListener::getSubscribedEvents ();
87
94
}
Original file line number Diff line number Diff line change @@ -38,6 +38,32 @@ public function testOnKernelRequestRemainsUntouched()
38
38
$ listener ->onKernelRequest ($ event );
39
39
}
40
40
41
+ public function testOnFinishRequestRemainsUntouched ()
42
+ {
43
+ if (!method_exists ('Symfony\Component\HttpKernel\EventListener\SessionListener ' , 'onFinishRequest ' )) {
44
+ $ this ->markTestSkipped ('Method onFinishRequest does not exist on Symfony\Component\HttpKernel\EventListener\SessionListener ' );
45
+ }
46
+
47
+ $ event = $ this
48
+ ->getMockBuilder ('Symfony\Component\HttpKernel\Event\FinishRequestEvent ' )
49
+ ->disableOriginalConstructor ()
50
+ ->getMock ();
51
+
52
+ $ inner = $ this
53
+ ->getMockBuilder ('Symfony\Component\HttpKernel\EventListener\SessionListener ' )
54
+ ->disableOriginalConstructor ()
55
+ ->getMock ();
56
+
57
+ $ inner
58
+ ->expects ($ this ->once ())
59
+ ->method ('onFinishRequest ' )
60
+ ->with ($ event )
61
+ ;
62
+
63
+ $ listener = $ this ->getListener ($ inner );
64
+ $ listener ->onFinishRequest ($ event );
65
+ }
66
+
41
67
/**
42
68
* @dataProvider onKernelResponseProvider
43
69
*/
You can’t perform that action at this time.
0 commit comments