use Symfony\Component\Security\Http\Tests\Authenticator\InMemoryAccessTokenHandler;
class FormEncodedBodyAccessTokenAuthenticatorTest extends TestCase
{ private InMemoryUserProvider
$userProvider;
private AccessTokenAuthenticator
$authenticator;
private AccessTokenHandlerInterface
$accessTokenHandler;
protected function setUp(): void
{ $this->userProvider =
new InMemoryUserProvider();
$this->accessTokenHandler =
new InMemoryAccessTokenHandler();
} public function testSupport() { $this->
setUpAuthenticator();
$request =
new Request([],
[],
[],
[],
[],
['CONTENT_TYPE' => 'application/x-www-form-urlencoded'
]);
$request->request->
set('access_token', 'INVALID_ACCESS_TOKEN'
);
$request->
setMethod(Request::METHOD_POST
);
$this->
assertNull($this->authenticator->
supports($request));
}