Skip to content
Snippets Groups Projects
Commit e96af1e0 authored by Jakob P's avatar Jakob P
Browse files

Fix incorrect logic on path

parent 0727f7f9
Branches 8.x-1.x
No related tags found
No related merge requests found
Pipeline #191019 failed with stage
in 41 minutes and 22 seconds
......@@ -39,6 +39,16 @@ final class MockedResponseMiddleware {
public function __invoke(): callable {
return function (callable $handler): callable {
return function (RequestInterface $request, array $options) use ($handler): PromiseInterface {
$path = $request->getUri()->getPath();
if ($path == '/api/rest/oauth/token') {
$auth_content = json_decode($request->getBody()->getContents());
if ($auth_content->authorization_code == 'server_error') {
return new FulfilledPromise(new Response(502));
}
elseif ($auth_content->authorization_code == 'client_error') {
return new FulfilledPromise(new Response(403));
}
}
if ($request->getUri()->getHost() === 'test.widencollective.disconnect') {
return new FulfilledPromise(new Response(200));
}
......
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