8000 minor #41567 [Security] Fix SerializableUser fixture (derrabus) · symfony/symfony@a850da5 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a850da5

Browse files
minor #41567 [Security] Fix SerializableUser fixture (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [Security] Fix SerializableUser fixture | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A That's hopefully the last `Serializable` implementation we need to fix. 😓 Commits ------- 8fbf3bb [Security] Fix SerializableUser fixture
2 parents b87de42 + 8fbf3bb commit a850da5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,22 @@ public function getSalt()
322322

323323
public function serialize(): string
324324
{
325-
return serialize($this->name);
325+
return serialize($this->__serialize());
326326
}
327327

328328
public function unserialize($serialized): void
329329
{
330-
$this->name = unserialize($serialized);
330+
$this->__unserialize(unserialize($serialized));
331+
}
332+
333+
public function __serialize(): array
334+
{
335+
return ['name' => $this->name];
336+
}
337+
338+
public function __unserialize(array $data): void
339+
{
340+
['name' => $this->name] = $data;
331341
}
332342
}
333343

0 commit comments

Comments
 (0)
0