From 7fb93058cf6ce0b64c8e3066ed31ad9f8552e486 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 21 Apr 2023 14:59:50 +0545 Subject: [PATCH] tidy up acceptance tests --- tests/TestHelpers/HttpRequestHelper.php | 4 ++-- tests/TestHelpers/SetupHelper.php | 2 +- tests/TestHelpers/SharingHelper.php | 4 ++-- tests/TestHelpers/UploadHelper.php | 2 +- .../expected-failures-webUI-on-OCIS-storage.md | 4 ++-- .../acceptance/features/apiSpaces/changeSpaces.feature | 4 ++-- .../acceptance/features/apiSpaces/notification.feature | 10 +++++----- tests/acceptance/features/apiSpaces/resharing.feature | 4 ++-- .../features/apiSpacesShares/copySpaces.feature | 2 +- .../features/apiSpacesShares/etagPropagation.feature | 2 +- .../features/apiSpacesShares/favorite.feature | 2 +- tests/acceptance/features/bootstrap/FeatureContext.php | 2 +- .../features/bootstrap/FilesVersionsContext.php | 2 +- tests/acceptance/features/bootstrap/GraphContext.php | 2 +- tests/acceptance/features/bootstrap/OCSContext.php | 2 +- tests/acceptance/features/bootstrap/Provisioning.php | 4 ++-- .../features/bootstrap/RoleAssignmentContext.php | 8 ++++---- tests/acceptance/features/bootstrap/Sharing.php | 6 +++--- tests/acceptance/features/bootstrap/SpacesContext.php | 4 ++-- .../acceptance/features/bootstrap/SpacesTUSContext.php | 2 +- tests/acceptance/features/bootstrap/TUSContext.php | 2 +- tests/acceptance/features/bootstrap/WebDav.php | 4 ++-- .../features/bootstrap/WebDavPropertiesContext.php | 2 +- .../uploadToShare.feature | 4 ++-- .../features/coreApiWebdavOperations/search.feature | 2 +- .../coreApiWebdavProperties1/setFileProperties.feature | 2 +- 26 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/TestHelpers/HttpRequestHelper.php b/tests/TestHelpers/HttpRequestHelper.php index caef4e444..4911c510e 100644 --- a/tests/TestHelpers/HttpRequestHelper.php +++ b/tests/TestHelpers/HttpRequestHelper.php @@ -369,7 +369,7 @@ class HttpRequestHelper { } /** - * Create an http request based on given parameters. + * Create an HTTP request based on given parameters. * This creates a RequestInterface object that can be used with a client to send a request. * This enables us to create multiple requests in advance so that we can send them to the server at once in parallel. * @@ -612,7 +612,7 @@ class HttpRequestHelper { * @throws Exception */ public static function getResponseXml(ResponseInterface $response, ?string $exceptionText = ''):SimpleXMLElement { - // rewind just to make sure we can re-parse it in case it was parsed already... + // rewind just to make sure we can reparse it in case it was parsed already... $response->getBody()->rewind(); $contents = $response->getBody()->getContents(); try { diff --git a/tests/TestHelpers/SetupHelper.php b/tests/TestHelpers/SetupHelper.php index 6a9778b2b..0a899ab8b 100644 --- a/tests/TestHelpers/SetupHelper.php +++ b/tests/TestHelpers/SetupHelper.php @@ -29,7 +29,7 @@ use Psr\Http\Message\ResponseInterface; use SimpleXMLElement; /** - * Helper to setup UI / Integration tests + * Helper to set up UI / Integration tests * * @author Artur Neumann * diff --git a/tests/TestHelpers/SharingHelper.php b/tests/TestHelpers/SharingHelper.php index 9fcc9154e..036772662 100644 --- a/tests/TestHelpers/SharingHelper.php +++ b/tests/TestHelpers/SharingHelper.php @@ -169,8 +169,8 @@ class SharingHelper { } /** - * calculates the permission sum (int) from given permissions - * permissions can be passed in as int, string or array of int or string + * Calculates the permission sum (int) from given permissions. + * Permissions can be passed in as int, string or array of int or string * 'read' => 1 * 'update' => 2 * 'create' => 4 diff --git a/tests/TestHelpers/UploadHelper.php b/tests/TestHelpers/UploadHelper.php index 1ff63cfa5..f216db4b1 100644 --- a/tests/TestHelpers/UploadHelper.php +++ b/tests/TestHelpers/UploadHelper.php @@ -164,7 +164,7 @@ class UploadHelper extends \PHPUnit\Framework\Assert { * @param string|null $source source file path * @param string|null $destination destination path on the server * @param string|null $xRequestId - * @param bool $overwriteMode when false creates separate files to test uploading brand new files, + * @param bool $overwriteMode when false creates separate files to test uploading brand-new files, * when true it just overwrites the same file over and over again with the same name * @param string|null $exceptChunkingType empty string or "old" or "new" * diff --git a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md index a8506d117..a30308520 100644 --- a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md @@ -7,10 +7,10 @@ Please follow this format for the actual expected failures. Level-3 headings should be used for the references to the relevant issues. Include the issue title with a link to the issue in GitHub. -Other free text and markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself. +Other free text and Markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself. -### [Exit page re-appears in loop when logged in user is deleted](https://github.com/owncloud/web/issues/4677) +### [Exit page re-appears in loop when logged-in user is deleted](https://github.com/owncloud/web/issues/4677) - [webUILogin/openidLogin.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L50) ### [Support for favorites](https://github.com/owncloud/ocis/issues/1228) diff --git a/tests/acceptance/features/apiSpaces/changeSpaces.feature b/tests/acceptance/features/apiSpaces/changeSpaces.feature index 9f553475a..de1bf54ad 100644 --- a/tests/acceptance/features/apiSpaces/changeSpaces.feature +++ b/tests/acceptance/features/apiSpaces/changeSpaces.feature @@ -118,7 +118,7 @@ Feature: Change data of space "properties": { "total" : { "type": "number", - "enum": [] + "enum": [] } } } @@ -126,7 +126,7 @@ Feature: Change data of space } """ Examples: - | user | code | expectedQuataValue | + | user | code | expectedQuotaValue | | Alice | 200 | 100 | | Brian | 403 | 20 | | Bob | 403 | 20 | diff --git a/tests/acceptance/features/apiSpaces/notification.feature b/tests/acceptance/features/apiSpaces/notification.feature index e3ec19992..25c295668 100644 --- a/tests/acceptance/features/apiSpaces/notification.feature +++ b/tests/acceptance/features/apiSpaces/notification.feature @@ -14,8 +14,8 @@ Feature: Notification Scenario: user gets a notification of space sharing - Given user "Alice" has created a space "notificaton checking" with the default quota using the GraphApi - And user "Alice" has shared a space "notificaton checking" with settings: + Given user "Alice" has created a space "notification checking" with the default quota using the GraphApi + And user "Alice" has shared a space "notification checking" with settings: | shareWith | Brian | | role | editor | When user "Brian" lists all notifications @@ -44,7 +44,7 @@ Feature: Notification }, "message": { "type": "string", - "enum": ["Alice Hansen added you to Space notificaton checking"] + "enum": ["Alice Hansen added you to Space notification checking"] }, "messageRich": { "type": "string", @@ -70,7 +70,7 @@ Feature: Notification }, "name": { "type": "string", - "enum": ["notificaton checking"] + "enum": ["notification checking"] } } }, @@ -104,7 +104,7 @@ Feature: Notification }, "object_id": { "type": "string" - + }, "object_type": { "type": "string", diff --git a/tests/acceptance/features/apiSpaces/resharing.feature b/tests/acceptance/features/apiSpaces/resharing.feature index 646eac9e3..f04073551 100644 --- a/tests/acceptance/features/apiSpaces/resharing.feature +++ b/tests/acceptance/features/apiSpaces/resharing.feature @@ -1,6 +1,6 @@ @api @skipOnOcV10 Feature: Resharing - As a user + As a user I want to reshare resources So that other users can have access to them @@ -101,7 +101,7 @@ Feature: Resharing | Damian | 31 | 404 | - Scenario Outline: Rrsharing files with different permissions + Scenario Outline: Resharing files with different permissions Given user "Alice" has uploaded file with content "Random data" to "/file.txt" And user "Alice" has shared file "/file.txt" with user "Brian" with permissions "" And user "Brian" has accepted share "/file.txt" offered by user "Alice" diff --git a/tests/acceptance/features/apiSpacesShares/copySpaces.feature b/tests/acceptance/features/apiSpacesShares/copySpaces.feature index 4e2310431..8f7103d27 100644 --- a/tests/acceptance/features/apiSpacesShares/copySpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/copySpaces.feature @@ -418,7 +418,7 @@ Feature: copy file | viewer | should not | 403 | - Scenario Outline: user copies a folder from personal space to share space with different permmissions + Scenario Outline: user copies a folder from personal space to share space with different permissions Given user "Brian" has created folder "/testshare" And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" And user "Alice" has accepted share "/testshare" offered by user "Brian" diff --git a/tests/acceptance/features/apiSpacesShares/etagPropagation.feature b/tests/acceptance/features/apiSpacesShares/etagPropagation.feature index 4a768cf71..cbf6e5d42 100644 --- a/tests/acceptance/features/apiSpacesShares/etagPropagation.feature +++ b/tests/acceptance/features/apiSpacesShares/etagPropagation.feature @@ -193,7 +193,7 @@ Feature: check etag propagation after different file alterations | Brian | /dst | Shares | - Scenario: share reciever moving a folder from one folder to an other changes the etags of both folders for all collaborators + Scenario: share receiver moving a folder from one folder to an other changes the etags of both folders for all collaborators Given user "Alice" has created folder "/dst" And user "Alice" has created folder "/upload/toMove" And user "Alice" has shared folder "/upload" with user "Brian" diff --git a/tests/acceptance/features/apiSpacesShares/favorite.feature b/tests/acceptance/features/apiSpacesShares/favorite.feature index 02cefe973..88883438f 100644 --- a/tests/acceptance/features/apiSpacesShares/favorite.feature +++ b/tests/acceptance/features/apiSpacesShares/favorite.feature @@ -1,7 +1,7 @@ @api @skipOnOcV10 Feature: favorite As a user - I want to favouite resources + I want to favorite resources So that I can access them quickly Background: diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 9c2ad3dc5..ccc3b21ba 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -2941,7 +2941,7 @@ class FeatureContext extends BehatVariablesContext { } /** - * returns a string that can be used to check a url of comments with + * returns a string that can be used to check a URL of comments with * regular expression (without delimiter) * * @return string diff --git a/tests/acceptance/features/bootstrap/FilesVersionsContext.php b/tests/acceptance/features/bootstrap/FilesVersionsContext.php index 7f26e3ed7..89639545c 100644 --- a/tests/acceptance/features/bootstrap/FilesVersionsContext.php +++ b/tests/acceptance/features/bootstrap/FilesVersionsContext.php @@ -385,7 +385,7 @@ class FilesVersionsContext implements Context { /** * returns the result parsed into an SimpleXMLElement - * with an registered namespace with 'd' as prefix and 'DAV:' as namespace + * with a registered namespace with 'd' as prefix and 'DAV:' as namespace * * @param string $user * @param string $fileId diff --git a/tests/acceptance/features/bootstrap/GraphContext.php b/tests/acceptance/features/bootstrap/GraphContext.php index 2c45b85a3..46f09acda 100644 --- a/tests/acceptance/features/bootstrap/GraphContext.php +++ b/tests/acceptance/features/bootstrap/GraphContext.php @@ -1373,7 +1373,7 @@ class GraphContext implements Context { * @return void * @throws JsonException */ - public function userRetrievesHisorHerInformationOfUserUsingGraphApi( + public function userRetrievesHisOrHerInformationOfUserUsingGraphApi( string $user ):void { $response = $this->retrieveUserInformationUsingGraphApi($user); diff --git a/tests/acceptance/features/bootstrap/OCSContext.php b/tests/acceptance/features/bootstrap/OCSContext.php index 491a5fc3f..8329f1f6e 100644 --- a/tests/acceptance/features/bootstrap/OCSContext.php +++ b/tests/acceptance/features/bootstrap/OCSContext.php @@ -935,7 +935,7 @@ class OCSContext implements Context { if (\is_object($jsonResponse) && $jsonResponse->ocs->meta->statuscode) { return (string) $jsonResponse->ocs->meta->statuscode; } - // go to xml response when json response is null (it means not formated and get status code) + // go to xml response when json response is null (it means not formatted and get status code) $responseXml = $this->featureContext->getResponseXml($response, __METHOD__); if (isset($responseXml->meta[0], $responseXml->meta[0]->statuscode)) { return (string) $responseXml->meta[0]->statuscode; diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 025b4f688..0fd4c0e80 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -686,7 +686,7 @@ trait Provisioning { $userId = \str_replace('+', '\+', $setting["userid"]); $newDN = 'uid=' . $userId . ',ou=' . $ou . ',' . $this->ldapBaseDN; - //pick a high number as uidnumber to make sure there are no conflicts with existing uidnumbers + //pick a high uidnumber to make sure there are no conflicts with existing uidnumbers $uidNumber = \count($this->ldapCreatedUsers) + 30000; $entry = []; $entry['cn'] = $userId; @@ -936,7 +936,7 @@ trait Provisioning { $body, ); } else { - // Create a OCS request for creating the user. The request is not sent to the server yet. + // Create an OCS request for creating the user. The request is not sent to the server yet. $request = OcsApiHelper::createOcsRequest( $this->getBaseUrl(), 'POST', diff --git a/tests/acceptance/features/bootstrap/RoleAssignmentContext.php b/tests/acceptance/features/bootstrap/RoleAssignmentContext.php index cf220cf64..537b1afc9 100644 --- a/tests/acceptance/features/bootstrap/RoleAssignmentContext.php +++ b/tests/acceptance/features/bootstrap/RoleAssignmentContext.php @@ -38,7 +38,7 @@ class RoleAssignmentContext implements Context { /** * @var string */ - private string $setttingsUrl = '/api/v0/settings/'; + private string $settingsUrl = '/api/v0/settings/'; /** * This will run before EVERY scenario. @@ -70,7 +70,7 @@ class RoleAssignmentContext implements Context { * @throws Exception */ public function getAllExistingRoles(string $user): void { - $fullUrl = $this->baseUrl . $this->setttingsUrl . "roles-list"; + $fullUrl = $this->baseUrl . $this->settingsUrl . "roles-list"; $this->featureContext->setResponse( $this->spacesContext->sendPostRequestToUrl($fullUrl, $user, $this->featureContext->getPasswordForUser($user), "{}") ); @@ -87,7 +87,7 @@ class RoleAssignmentContext implements Context { * @throws Exception */ public function sendRequestToAssignRoleToUser(string $user, string $userId, string $roleId): void { - $fullUrl = $this->baseUrl . $this->setttingsUrl . "assignments-add"; + $fullUrl = $this->baseUrl . $this->settingsUrl . "assignments-add"; $body = json_encode(["account_uuid" => $userId, "role_id" => $roleId], JSON_THROW_ON_ERROR); $this->featureContext->setResponse( @@ -105,7 +105,7 @@ class RoleAssignmentContext implements Context { * @throws Exception */ public function sendRequestAssignmentsList(string $user, string $userId): void { - $fullUrl = $this->baseUrl . $this->setttingsUrl . "assignments-list"; + $fullUrl = $this->baseUrl . $this->settingsUrl . "assignments-list"; $body = json_encode(["account_uuid" => $userId], JSON_THROW_ON_ERROR); $this->featureContext->setResponse( diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php index 9bb032184..406a54d83 100644 --- a/tests/acceptance/features/bootstrap/Sharing.php +++ b/tests/acceptance/features/bootstrap/Sharing.php @@ -331,7 +331,7 @@ trait Sharing { /** * @param string $user * @param TableNode|null $body - * TableNode $body should not have any heading and can have following rows | + * TableNode $body should not have any heading and can have the following rows | * | path | The folder or file path to be shared | * | name | A (human-readable) name for the share, | * | | which can be up to 64 characters in length. | @@ -355,7 +355,7 @@ trait Sharing { * | | (default: 31, for public shares: 1) | * | | Pass either the (total) number, | * | | or the keyword, | - * | | or an comma separated list of keywords | + * | | or a comma separated list of keywords | * | shareWith | The user or group id with which the file should | * | | be shared. | * | shareType | The type of the share. This can be one of: | @@ -3133,7 +3133,7 @@ trait Sharing { * Returns shares of a file or folder as a SimpleXMLElement * * Note: the "single" SimpleXMLElement may contain one or more actual - * shares (to users, groups or public links etc). If you access an item directly, + * shares (to users, groups or public links etc.). If you access an item directly, * for example, getShares()->id, then the value of "id" for the first element * will be returned. To access all the elements, you can loop through the * returned SimpleXMLElement with "foreach" - it will act like a PHP array diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index cf3b03496..32412f0b3 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1066,7 +1066,7 @@ class SpacesContext implements Context { * @return void * @throws Exception */ - public function usershouldNotHaveSpace( + public function userShouldNotHaveSpace( string $user, string $spaceName ): void { @@ -1803,7 +1803,7 @@ class SpacesContext implements Context { } /** - * returns a url for destination with spacename + * returns a URL for destination with spacename * * @param string $user * @param string $fileDestination diff --git a/tests/acceptance/features/bootstrap/SpacesTUSContext.php b/tests/acceptance/features/bootstrap/SpacesTUSContext.php index b967e9637..b50cfeab1 100644 --- a/tests/acceptance/features/bootstrap/SpacesTUSContext.php +++ b/tests/acceptance/features/bootstrap/SpacesTUSContext.php @@ -178,7 +178,7 @@ class SpacesTUSContext implements Context { * @param string $user * @param string $source * @param string $destination - * @param string $mtime Time in human readable format is taken as input which is converted into milliseconds that is used by API + * @param string $mtime Time in human-readable format is taken as input which is converted into milliseconds that is used by API * @param string $spaceName * * @return void diff --git a/tests/acceptance/features/bootstrap/TUSContext.php b/tests/acceptance/features/bootstrap/TUSContext.php index 15df1b8a3..af7df2988 100644 --- a/tests/acceptance/features/bootstrap/TUSContext.php +++ b/tests/acceptance/features/bootstrap/TUSContext.php @@ -288,7 +288,7 @@ class TUSContext implements Context { * @param string $user * @param string $source * @param string $destination - * @param string $mtime Time in human readable format is taken as input which is converted into milliseconds that is used by API + * @param string $mtime Time in human-readable format is taken as input which is converted into milliseconds that is used by API * * @return void * @throws Exception diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index d38a84e7b..49838962f 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -2315,7 +2315,7 @@ trait WebDav { } /** - * sets the chunking version from human readable format + * sets the chunking version from human-readable format * * @param string $version (no|v1|v2|new|old) * @@ -3044,7 +3044,7 @@ trait WebDav { * @param string $user * @param string $source * @param string $destination - * @param string $mtime Time in human readable format is taken as input which is converted into milliseconds that is used by API + * @param string $mtime Time in human-readable format is taken as input which is converted into milliseconds that is used by API * * @return void * @throws Exception diff --git a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php index 08cdec9a6..644943525 100644 --- a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php +++ b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php @@ -836,7 +836,7 @@ class WebDavPropertiesContext implements Context { // expected href should be like: "remote.php/webdav/strängé folder/file.txt" $explodeDecoded = \explode('/', $decodedValue); // get the first item of the expected href. - // i.e remote.php from "remote.php/webdav/strängé folder/file.txt" + // i.e. remote.php from "remote.php/webdav/strängé folder/file.txt" // or dav from "dav/spaces/%spaceid%/C++ file.cpp" $explodeExpected = \explode('/', $expectedHref); $remotePhpIndex = \array_search($explodeExpected[0], $explodeDecoded); diff --git a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature index a827d51a3..73f63c38b 100644 --- a/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature +++ b/tests/acceptance/features/coreApiShareOperationsToShares2/uploadToShare.feature @@ -168,7 +168,7 @@ Feature: sharing | new | @skipOnGraph - Scenario Outline: Uploading to a user shared folder with read/write permission when the sharer has unsufficient quota does not work + Scenario Outline: Uploading to a user shared folder with read/write permission when the sharer has insufficient quota does not work Given using DAV path And user "Brian" has been created with default attributes and small skeleton files And user "Alice" has created folder "FOLDER" @@ -188,7 +188,7 @@ Feature: sharing | new | - Scenario Outline: Uploading to a group shared folder with read/write permission when the sharer has unsufficient quota does not work + Scenario Outline: Uploading to a group shared folder with read/write permission when the sharer has insufficient quota does not work Given using DAV path And user "Brian" has been created with default attributes and without skeleton files And group "grp1" has been created diff --git a/tests/acceptance/features/coreApiWebdavOperations/search.feature b/tests/acceptance/features/coreApiWebdavOperations/search.feature index 352df0f88..b2bc0f7cd 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/search.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/search.feature @@ -156,7 +156,7 @@ Feature: Search | spaces | - Scenario Outline: limit returned search entries to more entires than there are + Scenario Outline: limit returned search entries to more entries than there are Given using DAV path When user "Alice" searches for "upload" and limits the results to "100" items using the WebDAV API Then the HTTP status code should be "207" diff --git a/tests/acceptance/features/coreApiWebdavProperties1/setFileProperties.feature b/tests/acceptance/features/coreApiWebdavProperties1/setFileProperties.feature index 623301326..7211ca041 100644 --- a/tests/acceptance/features/coreApiWebdavProperties1/setFileProperties.feature +++ b/tests/acceptance/features/coreApiWebdavProperties1/setFileProperties.feature @@ -2,7 +2,7 @@ Feature: set file properties As a user I want to be able to set meta-information about files - So that I can reccord file meta-information (detailed requirement TBD) + So that I can record file meta-information (detailed requirement TBD) Background: Given using OCS API version "1"