$tokenStorage =
new TokenStorage();
$tokenStorage->
setToken($token);
$resolver =
new UserValueResolver($tokenStorage);
$metadata =
new ArgumentMetadata('foo', InMemoryUser::
class, false, false, null, false,
[new CurrentUser()]);
$this->
assertSame([$user],
$resolver->
resolve(Request::
create('/'
),
$metadata));
} public function testResolveSucceedsWithNullableParamAndNoUser() { $token =
new NullToken();
$tokenStorage =
new TokenStorage();
$tokenStorage->
setToken($token);
$resolver =
new UserValueResolver($tokenStorage);
$metadata =
new ArgumentMetadata('foo', InMemoryUser::
class, false, false, null, true,
[new CurrentUser()]);
$this->
assertSame([null
],
$resolver->
resolve(Request::
create('/'
),
$metadata));
} public function testResolveSucceedsWithNullableAttribute() {