$verifier =
new CacheTokenVerifier(new ArrayAdapter());
$token =
new PersistentToken('class', 'user', 'series1@special:chars=/', 'value',
new \
DateTimeImmutable());
$this->
assertFalse($verifier->
verifyToken($token, 'wrong-value'
));
} public function testVerifyOutdatedToken() { $verifier =
new CacheTokenVerifier(new ArrayAdapter());
$outdatedToken =
new PersistentToken('class', 'user', 'series1@special:chars=/', 'value',
new \
DateTimeImmutable());
$newToken =
new PersistentToken('class', 'user', 'series1@special:chars=/', 'newvalue',
new \
DateTimeImmutable());
$verifier->
updateExistingToken($outdatedToken, 'newvalue',
new \
DateTimeImmutable());
$this->
assertTrue($verifier->
verifyToken($newToken, 'value'
));
}}