Skip to content
Snippets Groups Projects
Commit 821c416a authored by Ludovic Ganée's avatar Ludovic Ganée
Browse files

backport correction tests

parent 070994b1
No related branches found
No related tags found
No related merge requests found
Pipeline #84203 failed
......@@ -36,8 +36,15 @@ class KeycloakAuthenticatorTest extends TestCase
$json = json_encode(['preferred_username' => 'testunit', 'access_token' => 'test']); // user.1
$response = $this->createMock(Client\Response::class);
$response->method('getStringBody')->willReturn($json);
$client = $this->createMock(Client::class);
$client->method('post')->willReturn($response);
$client = new class extends Client {
public static Client\Response $response;
// phpcs:ignore
public function post(string $url, $data = [], array $options = []): Client\Response
{
return self::$response;
}
};
$client::$response = $response;
Utility::set(Client::class, $client);
$identity = new KeycloakIdentifier(['access_token' => 'test']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment