-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] Adds API tests for counting number of etag elements in response of a versioned file #38439
Conversation
b134316
to
d17a4f5
Compare
And user "Alice" has uploaded file with content "version 2" to "textfile0.txt" | ||
When user "Alice" gets the number of versions of file "textfile0.txt" | ||
Then the HTTP status code should be "207" | ||
And the number of etag element in the response should be "2" |
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.
Also, check the number of d:getlastmodified
tags as you have specified in the scenario title.
When user "Alice" gets the number of versions of file "textfile0.txt" | ||
Then the HTTP status code should be "207" | ||
And the number of etag element in the response should be "2" | ||
And the number of versions should be "2" |
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.
@Talank this checks the version by counting d:getlastmodified
so I thought that wouldn't be necessary. Maybe I should rephrase the scenario title.
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.
That works, I suppose.
@@ -448,6 +448,31 @@ public function theNumberOfVersionsShouldBe($number) { | |||
); | |||
} | |||
|
|||
/** | |||
* @Then the number of etag element in the response should be :arg1 |
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.
* @Then the number of etag element in the response should be :arg1 | |
* @Then the number of etag element in the response should be :number |
If you wish you can change it to something meaningful like this
else LGTM 👍
89e83b6
to
2ccc95d
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
@@ -448,6 +448,31 @@ public function theNumberOfVersionsShouldBe($number) { | |||
); | |||
} | |||
|
|||
/** | |||
* @Then the number of etag element in the response should be :number |
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.
* @Then the number of etag element in the response should be :number | |
* @Then the number of etag elements in the response should be :number |
Assert::assertEquals( | ||
$number, | ||
$actualNumber, | ||
"Expected number of etag element was '$number', but got '$actualNumber'" |
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.
"Expected number of etag element was '$number', but got '$actualNumber'" | |
"Expected number of etag elements was '$number', but got '$actualNumber'" |
2ccc95d
to
29b947c
Compare
29b947c
to
bf0d952
Compare
bf0d952
to
f6fddca
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
Adds API tests for counting number of etag elements in response of a versioned file
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: