Skip to content
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] adding test for editing shared file(OCM) by the share receiver #10523

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nirajacharya2
Copy link
Contributor

@nirajacharya2 nirajacharya2 commented Nov 8, 2024

Description

adding test for editing shared file(OCM) by the share receiver
bug coverage of #10358

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@nirajacharya2 nirajacharya2 self-assigned this Nov 8, 2024
@nirajacharya2 nirajacharya2 mentioned this pull request Nov 8, 2024
24 tasks
Copy link

sonarcloud bot commented Nov 26, 2024

Comment on lines +1366 to +1371
$this->featureContext->uploadFileWithContent(
$user,
$content,
$share,
$spaceId
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens with the share param in this function? is it used in the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is ignored.

if ($path === null) {
$path = "";
}
// get space id if testing with spaces dav
if ($spaceId === null && $davPathVersionToUse === self::DAV_VERSION_SPACES && !\in_array($type, ["public-files", "versions"])) {
$path = \ltrim($path, "/");
if (\str_starts_with($path, "Shares/")) {
$spaceId = self::getSharesSpaceIdForUser(
$baseUrl,
$user,
$password,
$xRequestId
);
$path = "/" . preg_replace("/^Shares\//", "", $path);
} else {
$spaceId = self::getPersonalSpaceIdForUserOrFakeIfNotFound(
$baseUrl,
$user,
$password,
$xRequestId
);
}
}

but leaving it in the step can make the step more clear or i can just delete it.

Copy link
Member

@saw-jan saw-jan Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if statement should not be triggered, right? because we send some value to $spaceId

Copy link
Member

@saw-jan saw-jan Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this url being hit:
https://localhost:10200/remote.php/dav/spaces/89f37a33-858b-45fa-8890-a1f2b27d90e1$f1c7b05d-38c4-4822-b30c-7c484b8ac287!L3RleHRmaWxlLnR4dA==/textfile.txt
but this should also work and this is what we want to do
https://localhost:10200/remote.php/dav/spaces/89f37a33-858b-45fa-8890-a1f2b27d90e1$f1c7b05d-38c4-4822-b30c-7c484b8ac287!L3RleHRmaWxlLnR4dA==/

you can send the empty string in that param

string $share,
string $content,
): void {
$spaceId = $this->featureContext->spacesContext->getSharesRemoteItemId($user, $share);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$spaceId = $this->featureContext->spacesContext->getSharesRemoteItemId($user, $share);
$spaceId = $this->getSharesRemoteItemId($user, $share);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants