File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -43,4 +43,16 @@ public function getCredentials()
43
43
{
44
44
return null ;
45
45
}
46
+
47
+ public function __serialize (): array
48
+ {
49
+ return [$ this ->firewallName , parent ::__serialize ()];
50
+ }
51
+
52
+ public function __unserialize (array $ data ): void
53
+ {
54
+ [$ this ->firewallName , $ parentData ] = $ data ;
55
+
56
+ parent ::__unserialize ($ parentData );
57
+ }
46
58
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Symfony \Bundle \FrameworkBundle \Tests \Test ;
4
+
5
+ use PHPUnit \Framework \TestCase ;
6
+ use Symfony \Bundle \FrameworkBundle \Test \TestBrowserToken ;
7
+
8
+ final class TestBrowserTokenTest extends TestCase
9
+ {
10
+ public function testCanBeSerializedAndUnserialized ()
11
+ {
12
+ $ token = unserialize (serialize (new TestBrowserToken ()));
13
+
14
+ $ this ->assertSame ('main ' , $ token ->getFirewallName ());
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments