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] Adjust public link tests for download, upload and other operations #37552

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-282
Feature: accessing a public link share

Background:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-288 @issue-ocis-reva-252
Feature: multilinksharing

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49
@issue-ocis-reva-233 @issue-ocis-reva-243
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-282
@issue-ocis-reva-233 @issue-ocis-reva-243 @issue-ocis-reva-289
Feature: reshare as public link
As a user
I want to create public link shares from files/folders shared with me
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-252
Feature: update a public link share

Background:
Expand Down

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions tests/acceptance/features/bootstrap/OCSContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,19 +583,22 @@ public function userRequestsTheseEndpointsWithUsingThePasswordOfUser($asUser, $m
* @throws Exception
*/
public function theOCSStatusCodeShouldBe($statusCode, $message = "") {
if ($message === "") {
$message = "OCS status code is not the expected value";
}

$responseStatusCode = $this->getOCSResponseStatusCode(
$this->featureContext->getResponse()
);
if (\is_array($statusCode)) {
if ($message === "") {
$message = "OCS status code is not any of the expected values " . \implode(",", $statusCode) . " got " . $responseStatusCode;
}
Assert::assertContainsEquals(
$responseStatusCode, $statusCode,
$message
);
} else {
if ($message === "") {
$message = "OCS status code is not the expected value " . $statusCode . " got " . $responseStatusCode;
}

Assert::assertEquals(
$statusCode, $responseStatusCode,
$message
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ public function createShare(
$this->sharingApiVersion
);
$this->lastShareData = $this->getResponseXml();
if ($shareType === 'public_link') {
if ($shareType === 'public_link' && isset($this->lastShareData->data)) {
$linkName = (string) $this->lastShareData->data[0]->name;
$linkUrl = (string) $this->lastShareData->data[0]->url;
$this->addToListOfCreatedPublicLinks($linkName, $linkUrl);
Expand All @@ -929,6 +929,7 @@ public function doesFieldValueMatchExpectedContent(
if (($contentExpected === "ANY_VALUE")
|| (($contentExpected === "A_TOKEN") && (\strlen($value) === 15))
|| (($contentExpected === "A_NUMBER") && \is_numeric($value))
|| (($contentExpected === "A_STRING") && \is_string($value))
|| (($contentExpected === "AN_URL") && $this->isAPublicLinkUrl($value))
|| (($field === 'remote') && (\rtrim($value, "/") === $contentExpected))
|| ($contentExpected === $value)
Expand Down