mirror of
https://github.com/owncloud/ocis.git
synced 2025-04-18 23:44:07 +03:00
remove testing app unused code
This commit is contained in:
parent
20f32d4f2a
commit
5c2b9c188d
@ -3555,115 +3555,6 @@ trait Sharing {
|
||||
$this->setResponse($this->saveLastSharedPublicLinkShare($user, $shareServer));
|
||||
}
|
||||
|
||||
/**
|
||||
* Expires last created public link share using the testing API
|
||||
*
|
||||
* @return void
|
||||
* @throws ResponseInterface
|
||||
*/
|
||||
public function expireLastCreatedPublicLinkShare(): ResponseInterface {
|
||||
$shareId = (string) $this->getLastCreatedPublicShare()->id;
|
||||
return $this->expireShare($shareId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expires a share using the testing API
|
||||
*
|
||||
* @param string|null $shareId optional share id, if null then expire the last share that was created.
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function expireShare(string $shareId = null): ResponseInterface {
|
||||
$adminUser = $this->getAdminUsername();
|
||||
if ($shareId === null) {
|
||||
$shareId = $this->getLastCreatedUserGroupShareId();
|
||||
}
|
||||
$response = OcsApiHelper::sendRequest(
|
||||
$this->getBaseUrl(),
|
||||
$adminUser,
|
||||
$this->getAdminPassword(),
|
||||
'POST',
|
||||
"/apps/testing/api/v1/expire-share/$shareId",
|
||||
$this->getStepLineRef(),
|
||||
[],
|
||||
$this->getOcsApiVersion()
|
||||
);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has expired the last created share using the testing API
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function theAdministratorHasExpiredTheLastCreatedShare(): void {
|
||||
$this->expireShare();
|
||||
$httpStatus = $this->getResponse()->getStatusCode();
|
||||
Assert::assertSame(
|
||||
200,
|
||||
$httpStatus,
|
||||
"Request to expire last share failed. HTTP status was '$httpStatus'"
|
||||
);
|
||||
$ocsStatusMessage = $this->ocsContext->getOCSResponseStatusMessage($this->getResponse());
|
||||
if ($this->getOcsApiVersion() === 1) {
|
||||
$expectedOcsStatusCode = "100";
|
||||
} else {
|
||||
$expectedOcsStatusCode = "200";
|
||||
}
|
||||
$this->ocsContext->theOCSStatusCodeShouldBe(
|
||||
$expectedOcsStatusCode,
|
||||
"Request to expire last share failed: '$ocsStatusMessage'"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has expired the last created public link share using the testing API
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function theAdministratorHasExpiredTheLastCreatedPublicLinkShare(): void {
|
||||
$this->expireLastCreatedPublicLinkShare();
|
||||
$httpStatus = $this->getResponse()->getStatusCode();
|
||||
Assert::assertSame(
|
||||
200,
|
||||
$this->getResponse()->getStatusCode(),
|
||||
"Request to expire last public link share failed. HTTP status was '$httpStatus'"
|
||||
);
|
||||
$ocsStatusMessage = $this->ocsContext->getOCSResponseStatusMessage($this->getResponse());
|
||||
if ($this->getOcsApiVersion() === 1) {
|
||||
$expectedOcsStatusCode = "100";
|
||||
} else {
|
||||
$expectedOcsStatusCode = "200";
|
||||
}
|
||||
$this->ocsContext->theOCSStatusCodeShouldBe(
|
||||
$expectedOcsStatusCode,
|
||||
"Request to expire last public link share failed: '$ocsStatusMessage'"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator expires the last created share using the testing API
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function theAdministratorExpiresTheLastCreatedShare(): void {
|
||||
$this->setResponse($this->expireShare());
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator expires the last created public link share using the testing API
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function theAdministratorExpiresTheLastCreatedPublicLinkShare(): void {
|
||||
$this->setResponse($this->expireLastCreatedPublicLinkShare());
|
||||
}
|
||||
|
||||
/**
|
||||
* replace values from table
|
||||
*
|
||||
@ -3708,218 +3599,4 @@ trait Sharing {
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array of common sharing capability settings for testing
|
||||
*/
|
||||
protected function getCommonSharingConfigs(): array {
|
||||
return [
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'auto_accept_share',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_auto_accept_share',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'api_enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_enabled',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_links',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@upload',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_public_upload',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'group_sharing',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_group_sharing',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'share_with_group_members_only',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_only_share_with_group_members',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'share_with_membership_groups_only',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_only_share_with_membership_groups',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'exclude_groups_from_sharing',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_exclude_groups',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'exclude_groups_from_sharing_list',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_exclude_groups_list',
|
||||
'testingState' => ''
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' =>
|
||||
'user_enumeration@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' =>
|
||||
'shareapi_allow_share_dialog_user_enumeration',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' =>
|
||||
'user_enumeration@@@group_members_only',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' =>
|
||||
'shareapi_share_dialog_user_enumeration_group_members',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'resharing',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_resharing',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' =>
|
||||
'public@@@password@@@enforced_for@@@read_only',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' =>
|
||||
'shareapi_enforce_links_password_read_only',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' =>
|
||||
'public@@@password@@@enforced_for@@@read_write',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' =>
|
||||
'shareapi_enforce_links_password_read_write',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' =>
|
||||
'public@@@password@@@enforced_for@@@upload_only',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' =>
|
||||
'shareapi_enforce_links_password_write_only',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@send_mail',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_public_notification',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@social_share',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_social_share',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@expire_date@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_default_expire_date',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'public@@@expire_date@@@enforced',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_enforce_expire_date',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'user@@@send_mail',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_allow_mail_notification',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'user@@@expire_date@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_default_expire_date_user_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'user@@@expire_date@@@enforced',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_enforce_expire_date_user_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'group@@@expire_date@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_default_expire_date_group_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'group@@@expire_date@@@enforced',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_enforce_expire_date_group_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'remote@@@expire_date@@@enabled',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_default_expire_date_remote_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'remote@@@expire_date@@@enforced',
|
||||
'testingApp' => 'core',
|
||||
'testingParameter' => 'shareapi_enforce_expire_date_remote_share',
|
||||
'testingState' => false
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'federation@@@outgoing',
|
||||
'testingApp' => 'files_sharing',
|
||||
'testingParameter' => 'outgoing_server2server_share_enabled',
|
||||
'testingState' => true
|
||||
],
|
||||
[
|
||||
'capabilitiesApp' => 'files_sharing',
|
||||
'capabilitiesParameter' => 'federation@@@incoming',
|
||||
'testingApp' => 'files_sharing',
|
||||
'testingParameter' => 'incoming_server2server_share_enabled',
|
||||
'testingState' => true
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user