@@ -40,20 +40,6 @@ public function testFromRawCookieChildClassWithNewConstructorSignature()
4040 $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
4141 }
4242
43- #[Group('legacy ' )]
44- #[IgnoreDeprecations]
45- public function testFromRawCookieChildClassWithLegacyConstructorSignature ()
46- {
47- $ this ->expectUserDeprecationMessage (\sprintf ('Since symfony/security-http 7.4: Extending the "%s" class and overriding the constructor with four required arguments is deprecated. Change the constructor signature to __construct(string $userIdentifier, int $expires, string $value). ' , RememberMeDetails::class));
48-
49- $ rememberMeDetails = RememberMeDetailsChildLegacyConstructorSignature::fromRawCookie (self ::getRememberMeCookieValue ());
50-
51- $ this ->assertSame (RememberMeDetailsChildLegacyConstructorSignature::class, $ rememberMeDetails ::class);
52- $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
53- $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
54- $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
55- }
56-
5743 public function testFromRawCookieChildClassWithoutConstructor ()
5844 {
5945 $ rememberMeDetails = RememberMeDetailsChildWithoutConstructor::fromRawCookie (self ::getRememberMeCookieValue ());
@@ -71,7 +57,6 @@ public function testFromLegacyRawCookie()
7157 $ rememberMeDetails = RememberMeDetails::fromRawCookie (self ::getLegacyRememberMeCookieValue ());
7258
7359 $ this ->assertSame (RememberMeDetails::class, $ rememberMeDetails ::class);
74- $ this ->assertSame (InMemoryUser::class, $ rememberMeDetails ->getUserFqcn ());
7560 $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
7661 $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
7762 $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
@@ -84,22 +69,6 @@ public function testFromLegacyRawCookieChildClassWithNewConstructorSignature()
8469 $ rememberMeDetails = RememberMeDetailsChild::fromRawCookie (self ::getLegacyRememberMeCookieValue ());
8570
8671 $ this ->assertSame (RememberMeDetailsChild::class, $ rememberMeDetails ::class);
87- $ this ->assertSame ('' , $ rememberMeDetails ->getUserFqcn ());
88- $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
89- $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
90- $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
91- }
92-
93- #[Group('legacy ' )]
94- #[IgnoreDeprecations]
95- public function testFromLegacyRawCookieChildClassWithLegacyConstructorSignature ()
96- {
97- $ this ->expectUserDeprecationMessage (\sprintf ('Since symfony/security-http 7.4: Extending the "%s" class and overriding the constructor with four required arguments is deprecated. Change the constructor signature to __construct(string $userIdentifier, int $expires, string $value). ' , RememberMeDetails::class));
98-
99- $ rememberMeDetails = RememberMeDetailsChildLegacyConstructorSignature::fromRawCookie (self ::getLegacyRememberMeCookieValue ());
100-
101- $ this ->assertSame (RememberMeDetailsChildLegacyConstructorSignature::class, $ rememberMeDetails ::class);
102- $ this ->assertSame (InMemoryUser::class, $ rememberMeDetails ->getUserFqcn ());
10372 $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
10473 $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
10574 $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
@@ -112,7 +81,6 @@ public function testFromLegacyRawCookieChildClassWithoutConstructor()
11281 $ rememberMeDetails = RememberMeDetailsChildWithoutConstructor::fromRawCookie (self ::getLegacyRememberMeCookieValue ());
11382
11483 $ this ->assertSame (RememberMeDetailsChildWithoutConstructor::class, $ rememberMeDetails ::class);
115- $ this ->assertSame (InMemoryUser::class, $ rememberMeDetails ->getUserFqcn ());
11684 $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
11785 $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
11886 $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
@@ -150,26 +118,6 @@ public function testFromPersistentTokenChildClassWithNewConstructorSignature()
150118 $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
151119 }
152120
153- #[Group('legacy ' )]
154- #[IgnoreDeprecations]
155- public function testFromPersistentTokenChildClassWithLegacyConstructorSignature ()
156- {
157- $ this ->expectUserDeprecationMessage (\sprintf ('Since symfony/security-http 7.4: Extending the "%s" class and overriding the constructor with four required arguments is deprecated. Change the constructor signature to __construct(string $userIdentifier, int $expires, string $value). ' , RememberMeDetails::class));
158-
159- if (method_exists (PersistentToken::class, 'getClass ' )) {
160- $ token = new PersistentToken (InMemoryUser::class, 'wouter ' , 'series1 ' , 'token_value ' , new \DateTimeImmutable (), false );
161- } else {
162- $ token = new PersistentToken ('wouter ' , 'series1 ' , 'token_value ' , new \DateTimeImmutable ());
163- }
164-
165- $ rememberMeDetails = RememberMeDetailsChildLegacyConstructorSignature::fromPersistentToken ($ token , 360 );
166-
167- $ this ->assertSame (RememberMeDetailsChildLegacyConstructorSignature::class, $ rememberMeDetails ::class);
168- $ this ->assertSame ('wouter ' , $ rememberMeDetails ->getUserIdentifier ());
169- $ this ->assertSame (360 , $ rememberMeDetails ->getExpires ());
170- $ this ->assertSame ('series1:token_value ' , $ rememberMeDetails ->getValue ());
171- }
172-
173121 public function testFromPersistentTokenChildClassWithoutConstructor ()
174122 {
175123 if (method_exists (PersistentToken::class, 'getClass ' )) {
@@ -193,7 +141,7 @@ private static function getRememberMeCookieValue(): string
193141
194142 private static function getLegacyRememberMeCookieValue (): string
195143 {
196- return base64_encode (( new RememberMeDetails ( InMemoryUser::class, 'wouter ' , 360 , 'series1:token_value ' , false ))->toString ());
144+ return base64_encode (strtr ( InMemoryUser::class, '\\' , ' . ' ).( new RememberMeDetails ( ' wouter ' , 360 , 'series1:token_value ' ))->toString ());
197145 }
198146}
199147
@@ -205,14 +153,6 @@ public function __construct(string $userIdentifier, int $expires, string $value)
205153 }
206154}
207155
208- class RememberMeDetailsChildLegacyConstructorSignature extends RememberMeDetails
209- {
210- public function __construct (string $ userFqcn , string $ userIdentifier , int $ expires , string $ value )
211- {
212- parent ::__construct ($ userFqcn , $ userIdentifier , $ expires , $ value );
213- }
214- }
215-
216156class RememberMeDetailsChildWithoutConstructor extends RememberMeDetails
217157{
218158}
0 commit comments