Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acquia_dam-3446787
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
acquia_dam-3446787
Commits
e96af1e0
Commit
e96af1e0
authored
7 months ago
by
Jakob P
Browse files
Options
Downloads
Patches
Plain Diff
Fix incorrect logic on path
parent
0727f7f9
Branches
8.x-1.x
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#191019
failed with stage
Stage: test
in 41 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/modules/acquia_dam_test/src/HttpClientMiddleware/MockedResponseMiddleware.php
+10
-0
10 additions, 0 deletions
...est/src/HttpClientMiddleware/MockedResponseMiddleware.php
with
10 additions
and
0 deletions
tests/modules/acquia_dam_test/src/HttpClientMiddleware/MockedResponseMiddleware.php
+
10
−
0
View file @
e96af1e0
...
...
@@ -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
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment