8000 [Security] Fix SerializableUser fixture · symfony/symfony@8fbf3bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8fbf3bb

Browse files
committed
[Security] Fix SerializableUser fixture
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent b87de42 commit 8fbf3bb

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