Skip to content

Commit e992e77

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

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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)