-
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]make escaping/encoding case insensitive #38374
Conversation
06d4c13
to
62e576b
Compare
4483adc
to
fd221f8
Compare
@@ -331,7 +331,6 @@ Feature: checksums | |||
Then the HTTP status code should be "400" | |||
And the content of file "/textfile0.txt" for user "Brian" should be "ownCloud test text file 0" plus end-of-line | |||
|
|||
@issue-ocis-reva-214 |
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.
do not delete this line this changes line number of other tests
$value = \strtolower($xmlPart[0]->__toString()); | ||
$pattern = \strtolower($this->featureContext->substituteInLineCodes($pattern, $user, ['preg_quote' => ['/']])); |
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.
I think we only want to do this for some properties such as d:href
, you can do this only for such properties otherwise do case sensitive comparisioin
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 👍
26cb80b
to
326cc9d
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.
I'm not sure if I'm happy with that, because now we are silently changing the regex and what the codes checks is not what the feature files says.
What about changing the regular expression in the places where its an issue?
@individual-it It was a problem for
So, this only changes the regex if we are checking response for /d:href like //d:response/d:href in this case. But for all the other cases it does not change the regex into lowercase.
|
@swoichha what about changing the regex itself to something like
/webdav\/file%20%3f2\.txt/i
|
@individual-it Yes, we can do that and it will work but in future we must have to remember doing the same for encoding case-insensitive characters. |
the quoted RFC is for all URIs https://tools.ietf.org/html/rfc3986#section-2.1 so we would have to make the substitution cleverer to match all percent encoding but then we have to be careful not to change if we want to check real I think the original solution would also match |
after verbal discussion with @swoichha
so the only real solution is to refactor all regex to be in the form of |
067058b
to
9bdc432
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
This PR makes tests of escaped file and folder names with special characters more flexible.
Related Issue
How Has This Been Tested?
Types of changes
Checklist: