-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tests-only][full-ci] removing the setResponse()
in given/then step in GraphContext
#7399
Conversation
@nirajacharya2 please write more in the PR title. |
setResponse()
in given/then step in GraphContext
41ed89b
to
befe277
Compare
setResponse()
in given/then step in GraphContextsetResponse()
in given/then step in GraphContext
7f53d2b
to
57c2f3c
Compare
7140bb5
to
6730f99
Compare
if ($response === $response) { | ||
$responseBody = $this->getJsonDecodedResponseBodyContent($response); | ||
} else { | ||
$responseBody = $this->getJsonDecodedResponseBodyContent(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$response = $response ?? $this->response;
$responseBody = $this->getJsonDecodedResponseBodyContent($response);
@@ -1445,13 +1445,17 @@ public function theOcsDataOfTheResponseShouldMatch( | |||
* @Then the JSON data of the response should match | |||
* | |||
* @param PyStringNode $schemaString | |||
* @param ResponseInterface $response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param ResponseInterface|null $response
6730f99
to
5e909c7
Compare
7760048
to
7074ff6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
7074ff6
to
4e12c48
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Description
We have used setResponse() and $this->response in the Given/Then steps and some helper functions (maybe to reuse existing available methods). But storing responses from Given/Then steps and helper functions is not a good idea because it can lead to a false positive assertion in the Then steps.
So, check the use of setResponse() and $this->response in
Related Issue
part of: #7082
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: