Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed May 23, 2023
1 parent ed1a467 commit 437a7a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/ocis/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ TEST_OCIS=true \
TEST_SERVER_URL="https://localhost:9200" \
EMAIL_HOST="localhost" \
EMAIL_PORT=9000 \
BEHAT_FEATURE="tests/acceptance/features/apiEmailNotification/emailNotification.feature" \
BEHAT_FEATURE="tests/acceptance/features/apiNotification/emailNotification.feature" \
make test-acceptance-api
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Feature: Notification
Scenario Outline: user gets a notification of unsharing resource
Given user "Alice" has shared entry "<resource>" with user "Brian"
And user "Brian" has accepted share "/<resource>" offered by user "Alice"
And user "Alice" has unshared folder "<resource>" for "Brian"
And user "Alice" has unshared folder "<resource>" form "Brian"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Resource unshared" and the message-details should match
Expand Down
15 changes: 7 additions & 8 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3055,7 +3055,7 @@ public function getShares(string $user, string $path):SimpleXMLElement {
$user,
$this->getPasswordForUser($user),
"GET",
$this->getSharesEndpointPath($path),
$this->getSharesEndpointPath("?path=$path"),
$this->getStepLineRef(),
[],
$this->ocsApiVersion
Expand All @@ -3075,7 +3075,7 @@ public function getShares(string $user, string $path):SimpleXMLElement {
*/
public function checkPublicShares(string $user, string $path, ?TableNode $TableNode):void {
$user = $this->getActualUsername($user);
$response = $this->getShares($user, "?path=$path");
$response = $this->getShares($user, $path);

$this->verifyTableNodeColumns($TableNode, ['path', 'permissions', 'name']);
if ($TableNode instanceof TableNode) {
Expand Down Expand Up @@ -3126,7 +3126,7 @@ public function checkPublicShares(string $user, string $path, ?TableNode $TableN
public function checkPublicSharesAreEmpty(string $user, string $entry, string $path):void {
$user = $this->getActualUsername($user);
$this->asFileOrFolderShouldExist($user, $entry, $path);
$response = $this->getShares($user, "?path=$path");
$response = $this->getShares($user, $path);
//It shouldn't have public shares
Assert::assertEquals(
0,
Expand All @@ -3146,7 +3146,7 @@ public function checkPublicSharesAreEmpty(string $user, string $entry, string $p
* @return string|null
*/
public function getPublicShareIDByName(string $user, string $path, string $name):?string {
$response = $this->getShares($user, "?path=$path");
$response = $this->getShares($user, $path);
foreach ($response as $elementResponded) {
if ((string) $elementResponded->name[0] === $name) {
return (string) $elementResponded->id[0];
Expand Down Expand Up @@ -3480,7 +3480,7 @@ public function assertNoSharesOfUserAreInState(string $user, string $state):void
}

/**
* @Given /^user "([^"]*)" has unshared folder "([^"]*)" for "([^"]*)"$/
* @Given /^user "([^"]*)" has unshared folder "([^"]*)" form "([^"]*)"$/
*
* @param string $sharer
* @param string $path
Expand All @@ -3489,12 +3489,11 @@ public function assertNoSharesOfUserAreInState(string $user, string $state):void
* @return void
* @throws JsonException
*/
public function userHasUnsharedFolderFor(string $sharer, string $path, string $sharee): void {
public function userHasUnsharedFolderForm(string $sharer, string $path, string $sharee): void {
$sharer = $this->getActualUsername($sharer);
$sharee = $this->getActualUsername($sharee);

$path = "?path=$path&share_types=0";
$response = $this->getShares($sharer, $path);
$response = $this->getShares($sharer, "$path&share_types=0");
$shareId = null;
foreach ($response as $shareElement) {
if ((string)$shareElement->share_with[0] === $sharee) {
Expand Down

0 comments on commit 437a7a8

Please sign in to comment.