Merge pull request #6107 from owncloud/acceptance-tests-tidy

[tests-only] tidy up acceptance tests
This commit is contained in:
Phil Davis
2023-04-21 16:28:40 +05:45
committed by GitHub
26 changed files with 44 additions and 44 deletions

View File

@@ -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 {

View File

@@ -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 <artur@jankaritech.com>
*

View File

@@ -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

View File

@@ -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"
*

View File

@@ -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)

View File

@@ -118,7 +118,7 @@ Feature: Change data of space
"properties": {
"total" : {
"type": "number",
"enum": [<expectedQuataValue>]
"enum": [<expectedQuotaValue>]
}
}
}
@@ -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 |

View File

@@ -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",

View File

@@ -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 "<shareepermissions>"
And user "Brian" has accepted share "/file.txt" offered by user "Alice"

View File

@@ -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 "<permissions>"
And user "Alice" has accepted share "/testshare" offered by user "Brian"

View File

@@ -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"

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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',

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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> 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> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And group "grp1" has been created

View File

@@ -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_version> 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"

View File

@@ -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"