Skip to content

Commit

Permalink
[tests-only] Fix share creation methods (#7400) (#7425)
Browse files Browse the repository at this point in the history
fix steps

add method to create folder

strict check for successful request

fix steps
  • Loading branch information
saw-jan authored Oct 6, 2023
1 parent 9cee6bc commit bfe0477
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 417 deletions.
2 changes: 2 additions & 0 deletions tests/TestHelpers/HttpRequestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ public static function getResponseXml(ResponseInterface $response, ?string $exce
* @return array
*/
public static function parseResponseAsXml(ResponseInterface $response):array {
// rewind so that we can reparse it if it was parsed already
$response->getBody()->rewind();
$body = $response->getBody()->getContents();
$parsedResponse = [];
if ($body && \substr($body, 0, 1) === '<') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ Feature: Email notification

Scenario: user gets an email notification when someone shares a file
Given user "Alice" has uploaded file with content "sample text" to "lorem.txt"
When user "Alice" has shared file "lorem.txt" with user "Brian" with permissions "17"
When user "Alice" shares file "lorem.txt" with user "Brian" with permissions "17" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And user "Brian" should have received the following email from user "Alice"
"""
Hello Brian Murphy
Expand Down Expand Up @@ -80,8 +81,9 @@ Feature: Email notification
And user "Brian" has switched the system language to "es"
And user "Carol" has switched the system language to "de"
And user "Alice" has created folder "/HelloWorld"
When user "Alice" has shared folder "/HelloWorld" with group "group1"
When user "Alice" shares folder "HelloWorld" with group "group1" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And user "Brian" should have received the following email from user "Alice"
"""
Hola Brian Murphy
Expand All @@ -108,8 +110,9 @@ Feature: Email notification
And user "Brian" has switched the system language to "es"
And user "Carol" has switched the system language to "de"
And user "Alice" has uploaded file with content "hello world" to "text.txt"
When user "Alice" has shared file "text.txt" with group "group1"
When user "Alice" shares file "text.txt" with group "group1" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And user "Brian" should have received the following email from user "Alice"
"""
Hola Brian Murphy
Expand Down
Loading

0 comments on commit bfe0477

Please sign in to comment.