Skip to content

Commit

Permalink
phpcs acceptance test style
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Sep 20, 2018
1 parent 05a833b commit ca0fc05
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function getDeletedNotification() {

/**
* @param int $deletedNotification
*
* @return void
*/
public function setDeletedNotification($deletedNotification) {
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public function userCreatesAPublicLinkShareOf($user, $path) {
* @Given /^the user has created a public link share of (?:file|folder) "([^"]*)"$/
*
* @param string $path
*
* @return void
*/
public function aPublicLinkShareOfIsCreated($path) {
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function getNewDavPath() {
* @Given /^using (old|new) (?:dav|DAV) path$/
*
* @param string $oldOrNewDavPath
*
* @return void
*/
public function usingOldOrNewDavPath($oldOrNewDavPath) {
Expand Down Expand Up @@ -897,6 +898,7 @@ public function userHasSetPropertyOfEntryTo(
*
* @param string $propertyName
* @param string $propertyValue
*
* @return void
* @throws \Exception
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function theAdminBrowsesToTheAdminSharingSettingsPage() {

/**
* @When /^the administrator (enables|disables) the share API using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -78,6 +79,7 @@ public function adminTogglesShareApiUsingTheWebui($action) {

/**
* @When /^the administrator (enables|disables) share via link using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -91,6 +93,7 @@ public function adminTogglesShareViaLink($action) {

/**
* @When /^the administrator (enables|disables) public uploads using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -104,6 +107,7 @@ public function adminTogglesPublicUpload($action) {

/**
* @When /^the administrator (enables|disables) mail notification on public link share using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -117,6 +121,7 @@ public function adminTogglesMailNotificationOnPublicLinkShare($action) {

/**
* @When /^the administrator (enables|disables) social media share on public link share using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -130,6 +135,7 @@ public function adminTogglesSocialShareOnPublicLinkShare($action) {

/**
* @When /^the administrator (enables|disables) enforce password protection for read-only links using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -143,6 +149,7 @@ public function adminTogglesEnforcePasswordProtectionForReadOnlyLinks($action) {

/**
* @When /^the administrator (enables|disables) enforce password protection for read and write links using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -156,6 +163,7 @@ public function adminTogglesEnforcePasswordProtectionForReadWriteLinks($action)

/**
* @When /^the administrator (enables|disables) enforce password protection for upload only links using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -169,6 +177,7 @@ public function adminTogglesEnforcePasswordProtectionForWriteOnlyLinks($action)

/**
* @When /^the administrator (enables|disables) resharing using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -182,6 +191,7 @@ public function adminTogglesDisableResharing($action) {

/**
* @When /^the administrator (enables|disables) sharing with groups using the webUI$/
*
* @param string $action
*
* @return void
Expand All @@ -195,6 +205,7 @@ public function adminTogglesSharingWithGroupUsingTheWebui($action) {

/**
* @When /^the administrator (enables|disables) restrict users to only share with their group members using the webUI$/
*
* @param string $action
*
* @return void
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/features/bootstrap/WebUIFilesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public function theUserBrowsesToTheFilesPage() {
* @param string $tabName
* @param string $fileName
* @param string $folderName
*
* @return void
* @throws Exception
*/
Expand Down Expand Up @@ -416,6 +417,7 @@ public function thereShouldBeNoFilesFoldersListedOnTheWebUI() {
* @Then there should be exactly :count folder/folders listed on the webUI
*
* @param string $count that is numeric
*
* @return void
*/
public function thereShouldBeCountFilesFoldersListedOnTheWebUI($count) {
Expand Down
9 changes: 9 additions & 0 deletions tests/acceptance/features/bootstrap/WebUISearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class WebUISearchContext extends RawMinkContext implements Context {
/**
* WebUILoginContext constructor.
*
* @param OwncloudPage $ownCloudPage
* @param SearchResultInOtherFoldersPage $searchResultInOtherFoldersPage
*/
public function __construct(
Expand All @@ -83,8 +84,12 @@ public function theUserSearchesUsingTheWebUI($searchTerm) {

/**
* @Then /^the (?:file|folder) ((?:'[^']*')|(?:"[^"]*")) with the path ((?:'[^']*')|(?:"[^"]*")) should (not|)\s?be listed in the search results in other folders section on the webUI$/
*
* @param string $fileName
* @param string $path
* @param string $shouldOrNot
*
* @return void
*/
public function fileShouldBeListedSearchResultOtherFolders($fileName, $path, $shouldOrNot) {
$fileName = \trim($fileName, $fileName[0]);
Expand All @@ -99,6 +104,10 @@ public function fileShouldBeListedSearchResultOtherFolders($fileName, $path, $sh
* @Then /^the (?:file|folder) ((?:'[^']*')|(?:"[^"]*")) should (not|)\s?be listed in the search results in other folders section on the webUI$/
*
* @param string $fileName
* @param string $shouldOrNot
*
* @return void
* @throws Exception
*/
public function fileShouldNotBeListedSearchResultOtherFolders($fileName, $shouldOrNot) {
$fileName = \trim($fileName, $fileName[0]);
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/features/bootstrap/WebUISharingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ public function userReactsToShareOfferedByUsingWebUI(
* @When the public accesses the last created public link with password :password using the webUI
*
* @param string $password
*
* @return void
*/
public function thePublicAccessesPublicLinkWithPasswordUsingTheWebui($password) {
Expand All @@ -509,6 +510,7 @@ public function thePublicAccessesPublicLinkWithPasswordUsingTheWebui($password)
* @When the public tries to access the last created public link with wrong password :wrongPassword using the webUI
*
* @param string $wrongPassword
*
* @return void
*/
public function thePublicTriesToAccessPublicLinkWithWrongPasswordUsingTheWebui($wrongPassword) {
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/features/bootstrap/WebUIUserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function __construct(OwncloudPage $owncloudPage) {
* @Then :displayname should be shown as the name of the current user on the WebUI
*
* @param string $displayname
*
* @return void
*/
public function displayNameOfTheCurrentUserOnTheWebUiShouldBe($displayname) {
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/FavoritesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ protected function getEmptyContentXpath() {
}

/**
*
* {@inheritDoc}
*
* @see \Page\FilesPageBasic::getFilePathInRowXpath()
*
* @return void
*/
protected function getFilePathInRowXpath() {
throw new \Exception("not implemented in FavoritesPage");
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/FilesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ protected function getEmptyContentXpath() {
}

/**
*
* {@inheritDoc}
*
* @see \Page\FilesPageBasic::getFilePathInRowXpath()
*
* @return void
*/
protected function getFilePathInRowXpath() {
throw new \Exception("not implemented in FilesPage");
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/lib/FilesPageBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public function findFileRowByName($name, Session $session) {
* useful for pages where multiple files with the same name can be displayed
*
* @param string|array $name
* @param string $path
* @param Session $session
*
* @return FileRow
* @throws ElementNotFoundException
*/
public function findFileRowByNameAndPath($name, $path, Session $session) {
$fileRows = $this->findAllFileRowsByName($name, $session);
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/features/lib/FilesPageElement/FileRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public function getTooltip() {
* return the path of the current file
*
* @param string $xpath xpath related to the fileRow element
*
* @throws ElementNotFoundException
* @return string
*/
Expand Down
1 change: 0 additions & 1 deletion tests/acceptance/features/lib/LoginPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function getLostPasswordMessage() {
/**
*
* @param string $newPassword
*
* @param Session $session
*
* @return void
Expand Down
3 changes: 3 additions & 0 deletions tests/acceptance/features/lib/OwncloudPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ public function isAvatarVisible() {
*
* @param Session $session
* @param string $searchTerm
*
* @throws ElementNotFoundException
* @return void
*/
public function search($session, $searchTerm) {
$searchbox = $this->findById($this->searchBoxId);
Expand All @@ -329,6 +331,7 @@ public function search($session, $searchTerm) {
$searchResultInOtherFoldersPage = $this->getPage("SearchResultInOtherFoldersPage");
$searchResultInOtherFoldersPage->waitTillPageIsLoaded($session);
}

/**
* return the path to the relevant page
*
Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/features/lib/PublicLinkFilesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ protected function getEmptyContentXpath() {
}

/**
*
* {@inheritDoc}
*
* @see \Page\FilesPageBasic::getFilePathInRowXpath()
*
* @throws \Exception
* @return void
*/
protected function getFilePathInRowXpath() {
throw new \Exception("not implemented in PublicLinkFilesPage");
Expand Down
19 changes: 17 additions & 2 deletions tests/acceptance/features/lib/SearchResultInOtherFoldersPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,38 @@ class SearchResultInOtherFoldersPage extends FilesPageBasic {
protected $fileNameMatchXpath = "//div[@class='name' and .=%s]";
protected $fileNamesXpath = "//div[@class='name']";
protected $filePathInRowXpath = "//div[@class='path']";


/**
* @return string
*/
protected function getEmptyContentXpath() {
return $this->emptyContentXpath;
}

/**
* @return string
*/
protected function getFileNameMatchXpath() {
return $this->fileNameMatchXpath;
}

/**
* @return string
*/
protected function getFileNamesXpath() {
return $this->fileNamesXpath;
}

/**
* @return string
*/
protected function getFileListXpath() {
return $this->fileListXpath;
}


/**
* @return string
*/
protected function getFilePathInRowXpath() {
return $this->filePathInRowXpath;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/SharedWithYouPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ protected function getEmptyContentXpath() {
}

/**
*
* {@inheritDoc}
*
* @see \Page\FilesPageBasic::getFilePathInRowXpath()
*
* @return void
*/
protected function getFilePathInRowXpath() {
throw new \Exception("not implemented in SharedWithYouPage");
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/features/lib/TrashbinPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ protected function getEmptyContentXpath() {
}

/**
*
* {@inheritDoc}
*
* @see \Page\FilesPageBasic::getFilePathInRowXpath()
*
* @return void
*/
protected function getFilePathInRowXpath() {
throw new \Exception("not implemented in TrashbinPage");
Expand Down

0 comments on commit ca0fc05

Please sign in to comment.