use Symfony\Component\Security\Http\Controller\SecurityTokenValueResolver;
class SecurityTokenValueResolverTest extends TestCase
{ public function testResolveSucceedsWithTokenInterface() { $user =
new InMemoryUser('username', 'password'
);
$token =
new UsernamePasswordToken($user, 'provider'
);
$tokenStorage =
new TokenStorage();
$tokenStorage->
setToken($token);
$resolver =
new SecurityTokenValueResolver($tokenStorage);
$metadata =
new ArgumentMetadata('foo', TokenInterface::
class, false, false, null
);
$this->
assertSame([$token],
$resolver->
resolve(Request::
create('/'
),
$metadata));
} public function testResolveSucceedsWithSubclassType() { $user =
new InMemoryUser('username', 'password'
);
$token =
new UsernamePasswordToken($user, 'provider'
);
$tokenStorage =
new TokenStorage();
$tokenStorage->
setToken($token);