Skip to content

Commit 18ad416

Browse files
minor symfony#58423 [Security] Fix serialized object representation in tests (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Fix serialized object representation in tests | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT `LegacyRoleTest` triggers the following error: ``` Legacy deprecation triggered by Symfony\Component\Security\Core\Tests\Role\LegacyRoleTest::testPayloadFromV4CanBeUnserialized: Creation of dynamic property Symfony\Component\Security\Core\Role\Role::$Symfony\Component\Security\Core\Role\Role is deprecated ``` Commits ------- f9f3cb5 [Security] Fix serialized object representation in tests
2 parents 199287e + f9f3cb5 commit 18ad416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Security/Core/Tests/Role/LegacyRoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LegacyRoleTest extends TestCase
1818
{
1919
public function testPayloadFromV4CanBeUnserialized()
2020
{
21-
$serialized = 'C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":236:{a:3:{i:0;N;i:1;s:4:"main";i:2;a:5:{i:0;s:2:"sf";i:1;b:1;i:2;a:1:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Role'."\0".'role'."\0".'";s:9:"ROLE_USER";}}i:3;a:0:{}i:4;a:1:{i:0;s:9:"ROLE_USER";}}}}';
21+
$serialized = 'C:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":236:{a:3:{i:0;N;i:1;s:4:"main";i:2;a:5:{i:0;s:2:"sf";i:1;b:1;i:2;a:1:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"'."\0".'Symfony\Component\Security\Core\Role\Role'."\0".'role";s:9:"ROLE_USER";}}i:3;a:0:{}i:4;a:1:{i:0;s:9:"ROLE_USER";}}}}';
2222

2323
$token = unserialize($serialized);
2424

0 commit comments

Comments
 (0)