protected function setUp(): void
{ $this->userProvider =
new InMemoryUserProvider();
$hasherFactory =
$this->
createMock(PasswordHasherFactoryInterface::
class);
$hasher =
$this->
createMock(PasswordHasherInterface::
class);
$hasherFactory ->
expects($this->
any()) ->
method('getPasswordHasher'
) ->
willReturn($hasher);
$this->authenticator =
new HttpBasicAuthenticator('test',
$this->userProvider
);
} public function testExtractCredentialsAndUserFromRequest() { $request =
new Request([],
[],
[],
[],
[],
[ 'PHP_AUTH_USER' => 'TheUsername',
'PHP_AUTH_PW' => 'ThePassword',
]);
$this->userProvider->
createUser($user =
new InMemoryUser('TheUsername', 'ThePassword'
));