diff --git a/tests/acceptance/features/apiMain/carddav.feature b/tests/acceptance/features/apiMain/carddav.feature
index 62df5e650de8..b99c7e750646 100644
--- a/tests/acceptance/features/apiMain/carddav.feature
+++ b/tests/acceptance/features/apiMain/carddav.feature
@@ -6,28 +6,28 @@ Feature: carddav
@carddav
Scenario: Accessing a not existing addressbook of another user
- When user "admin" requests addressbook "user0/MyAddressbook" using the API
+ When user "admin" requests address book "user0/MyAddressbook" using the API
Then the CardDAV HTTP status code should be "404"
And the CardDAV exception should be "Sabre\DAV\Exception\NotFound"
And the CardDAV error message should be "Addressbook with name 'MyAddressbook' could not be found"
@carddav
Scenario: Accessing a not shared addressbook of another user
- And user "admin" has successfully created an addressbook named "MyAddressbook"
- When user "user0" requests addressbook "admin/MyAddressbook" using the API
+ And user "admin" has successfully created an address book named "MyAddressbook"
+ When user "user0" requests address book "admin/MyAddressbook" using the API
Then the CardDAV HTTP status code should be "404"
And the CardDAV exception should be "Sabre\DAV\Exception\NotFound"
And the CardDAV error message should be "Addressbook with name 'MyAddressbook' could not be found"
@carddav
Scenario: Accessing a not existing addressbook of myself
- When user "user0" requests addressbook "admin/MyAddressbook" using the API
+ When user "user0" requests address book "admin/MyAddressbook" using the API
Then the CardDAV HTTP status code should be "404"
And the CardDAV exception should be "Sabre\DAV\Exception\NotFound"
And the CardDAV error message should be "Addressbook with name 'MyAddressbook' could not be found"
@carddav
Scenario: Creating a new addressbook
- Given user "user0" has successfully created an addressbook named "MyAddressbook"
- When user "user0" requests addressbook "user0/MyAddressbook" using the API
+ Given user "user0" has successfully created an address book named "MyAddressbook"
+ When user "user0" requests address book "user0/MyAddressbook" using the API
Then the CardDAV HTTP status code should be "200"
diff --git a/tests/acceptance/features/apiMain/tags.feature b/tests/acceptance/features/apiMain/tags.feature
index bc7d49c0cf6a..e5cbb112b7c9 100644
--- a/tests/acceptance/features/apiMain/tags.feature
+++ b/tests/acceptance/features/apiMain/tags.feature
@@ -185,10 +185,10 @@ Feature: tags
When user "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" owned by "user0" using the API
And user "another_admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "201"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MyFirstTag | normal |
| MySecondTag | not user-visible |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MyFirstTag | normal |
Scenario: Assigning a not user-assignable tag to a file shared by someone else as admin user should work
@@ -202,10 +202,10 @@ Feature: tags
When user "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0" using the API
And user "another_admin" adds the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "201"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MyFirstTag | normal |
| MySecondTag | not user-assignable |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MyFirstTag | normal |
| MySecondTag | not user-assignable |
@@ -220,7 +220,7 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" owned by "user0"
When user "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "204"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MySecondTag | normal |
Scenario: Unassigning a normal tag from a file unshared by someone else as regular user should fail
@@ -233,7 +233,7 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
When user "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "404"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MyFirstTag | normal |
| MySecondTag | normal |
@@ -251,9 +251,9 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
When user "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "404"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MySecondTag | normal |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MyFirstTag | not user-visible |
| MySecondTag | normal |
@@ -271,9 +271,9 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
When user "another_admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "204"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MySecondTag | normal |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MySecondTag | normal |
Scenario: Unassigning a not user-visible tag from a file unshared by someone else should fail
@@ -306,10 +306,10 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
When user "user1" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "403"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MyFirstTag | not user-assignable |
| MySecondTag | normal |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MyFirstTag | not user-assignable |
| MySecondTag | normal |
@@ -327,9 +327,9 @@ Feature: tags
And user "user0" has added the tag "MySecondTag" to "/myFileToTag.txt" shared by "user0"
When user "another_admin" removes the tag "MyFirstTag" from "/myFileToTag.txt" shared by "user0" using the API
Then the HTTP status code should be "204"
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ And file "/myFileToTag.txt" should have the following tags for user "user0"
| MySecondTag | normal |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "another_admin"
+ And file "/myFileToTag.txt" should have the following tags for user "another_admin"
| MySecondTag | normal |
Scenario: Unassigning a not user-assignable tag from a file unshared by someone else should fail
@@ -370,9 +370,9 @@ Feature: tags
And user "admin" has created a "normal" tag with name "MyFirstTag"
And user "user0" has uploaded file "data/textfile.txt" to "/myFileToTag.txt"
When user "user0" adds the tag "MyFirstTag" to "/myFileToTag.txt" shared by "user0" using the API
- Then file "/myFileToTag.txt" shared by "user0" should have the following tags for "user0"
+ Then file "/myFileToTag.txt" should have the following tags for user "user0"
| MyFirstTag | normal |
- And file "/myFileToTag.txt" shared by "user0" should have the following tags for "user1"
+ And file "/myFileToTag.txt" should have the following tags for user "user1"
||
Scenario: User can assign tags when in the tag's groups
diff --git a/tests/acceptance/features/apiProvisioning-v1/getUserGroups.feature b/tests/acceptance/features/apiProvisioning-v1/getUserGroups.feature
index eab9ef1a4505..1acfdfda0198 100644
--- a/tests/acceptance/features/apiProvisioning-v1/getUserGroups.feature
+++ b/tests/acceptance/features/apiProvisioning-v1/getUserGroups.feature
@@ -52,4 +52,12 @@ So that I can manage group membership
When user "anotheruser" sends HTTP method "GET" to API endpoint "/cloud/users/newuser/groups"
Then the OCS status code should be "997"
And the HTTP status code should be "401"
- And the API should not return any data
\ No newline at end of file
+ And the API should not return any data
+
+ Scenario: admin gets groups of an user who is not in any groups
+ Given user "brand-new-user" has been created
+ And group "unused-group" has been created
+ When user "admin" sends HTTP method "GET" to API endpoint "/cloud/users/brand-new-user/groups"
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And the list of groups returned by the API should be empty
diff --git a/tests/acceptance/features/apiTrashbin/trashbin-new-endpoint.feature b/tests/acceptance/features/apiTrashbin/trashbin-new-endpoint.feature
index 92821d1b716e..8b4a9add47c7 100644
--- a/tests/acceptance/features/apiTrashbin/trashbin-new-endpoint.feature
+++ b/tests/acceptance/features/apiTrashbin/trashbin-new-endpoint.feature
@@ -86,7 +86,7 @@ Feature: trashbin-new-endpoint
And user "user0" has deleted file "/textfile0.txt"
And user "user0" has deleted file "/textfile1.txt"
And as "user0" the file "/textfile0.txt" should exist in trash
- And as "user0" the file "/textfile0.txt" should exist in trash
+ And as "user0" the file "/textfile1.txt" should exist in trash
When user "user0" empties the trashbin using the API
Then as "user0" the file with original path "/textfile0.txt" should not exist in trash
And as "user0" the file with original path "/textfile1.txt" should not exist in trash
diff --git a/tests/acceptance/features/apiTrashbin/trashbin-old-endpoint.feature b/tests/acceptance/features/apiTrashbin/trashbin-old-endpoint.feature
index e12ab4515e6f..bd3d57c72deb 100644
--- a/tests/acceptance/features/apiTrashbin/trashbin-old-endpoint.feature
+++ b/tests/acceptance/features/apiTrashbin/trashbin-old-endpoint.feature
@@ -86,7 +86,7 @@ Feature: trashbin-new-endpoint
And user "user0" has deleted file "/textfile0.txt"
And user "user0" has deleted file "/textfile1.txt"
And as "user0" the file "/textfile0.txt" should exist in trash
- And as "user0" the file "/textfile0.txt" should exist in trash
+ And as "user0" the file "/textfile1.txt" should exist in trash
When user "user0" empties the trashbin using the API
Then as "user0" the file with original path "/textfile0.txt" should not exist in trash
And as "user0" the file with original path "/textfile1.txt" should not exist in trash
diff --git a/tests/acceptance/features/bootstrap/AppConfiguration.php b/tests/acceptance/features/bootstrap/AppConfiguration.php
index 3293a5f1113e..324307290432 100644
--- a/tests/acceptance/features/bootstrap/AppConfiguration.php
+++ b/tests/acceptance/features/bootstrap/AppConfiguration.php
@@ -22,7 +22,7 @@
*
*/
-use Behat\Behat\Hook\Scope\BeforeScenarioScope;
+use Behat\Gherkin\Node\TableNode;
use TestHelpers\AppConfigHelper;
require __DIR__ . '/../../../../lib/composer/autoload.php';
@@ -58,7 +58,7 @@ abstract public function sendingTo($verb, $url);
/**
* @param string $verb
* @param string $url
- * @param \Behat\Gherkin\Node\TableNode $body
+ * @param TableNode $body
*
* @return void
*/
@@ -247,7 +247,7 @@ protected function modifyServerConfig($app, $parameter, $value) {
}
/**
- * @param string $appParameterValues
+ * @param array $appParameterValues
*
* @return void
*/
@@ -300,10 +300,9 @@ abstract protected function resetAppConfigs();
/**
* @BeforeScenario
*
- * @param BeforeScenarioScope $scope
* @return void
*/
- public function prepareParametersBeforeScenario(BeforeScenarioScope $scope) {
+ public function prepareParametersBeforeScenario() {
$user = $this->currentUser;
$this->currentUser = $this->getAdminUsername();
$this->resetAppConfigs();
diff --git a/tests/acceptance/features/bootstrap/Auth.php b/tests/acceptance/features/bootstrap/Auth.php
index 98dfddb65c6b..90ac71276181 100644
--- a/tests/acceptance/features/bootstrap/Auth.php
+++ b/tests/acceptance/features/bootstrap/Auth.php
@@ -263,7 +263,7 @@ public function aNewBrowserSessionForHasBeenStarted($user) {
* @param string $hasOrNot
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function tokenAuthHasBeenEnforced($hasOrNot) {
$enforce = (($hasOrNot !== "not") && ($hasOrNot !== "does not enforce"));
diff --git a/tests/acceptance/features/bootstrap/BasicStructure.php b/tests/acceptance/features/bootstrap/BasicStructure.php
index 8e1fcf7c7a11..b03208f63092 100644
--- a/tests/acceptance/features/bootstrap/BasicStructure.php
+++ b/tests/acceptance/features/bootstrap/BasicStructure.php
@@ -929,12 +929,12 @@ public function statusPhpRespondedShouldMatch(PyStringNode $jsonExpected) {
$jsonExpectedDecoded['version'] = \trim($version[1]);
$jsonExpectedDecoded['versionstring'] = \trim($versionString[1]);
$jsonExpectedEncoded = \json_encode($jsonExpectedDecoded);
+ PHPUnit\Framework\Assert::assertEquals(
+ $jsonExpectedEncoded, $jsonRespondedEncoded
+ );
} else {
PHPUnit_Framework_Assert::fail('Cannot get version variables from occ');
}
- PHPUnit\Framework\Assert::assertEquals(
- $jsonExpectedEncoded, $jsonRespondedEncoded
- );
}
/**
@@ -1052,6 +1052,7 @@ public static function removeFilesFromLocalStorageAfter() {
* @param BeforeSuiteScope $scope
*
* @return void
+ * @throws \Exception
*/
public static function useBigFileIDs(BeforeSuiteScope $scope) {
$fullUrl = \getenv('TEST_SERVER_URL');
diff --git a/tests/acceptance/features/bootstrap/CalDavContext.php b/tests/acceptance/features/bootstrap/CalDavContext.php
index 0067eb899d7e..dd626e6a23f3 100644
--- a/tests/acceptance/features/bootstrap/CalDavContext.php
+++ b/tests/acceptance/features/bootstrap/CalDavContext.php
@@ -185,6 +185,7 @@ public function theCalDavErrorMessageShouldBe($message) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function userHasCreatedACalendarNamed($user, $name) {
$davUrl = $this->featureContext->getBaseUrl()
diff --git a/tests/acceptance/features/bootstrap/CardDavContext.php b/tests/acceptance/features/bootstrap/CardDavContext.php
index a69c2eee5e31..77ad278249f0 100644
--- a/tests/acceptance/features/bootstrap/CardDavContext.php
+++ b/tests/acceptance/features/bootstrap/CardDavContext.php
@@ -84,7 +84,7 @@ public function afterScenario() {
}
/**
- * @When user :user requests addressbook :addressBook using the API
+ * @When user :user requests address book :addressBook using the API
*
* @param string $user
* @param string $addressBook
@@ -92,7 +92,7 @@ public function afterScenario() {
* @return void
* @throws \Exception
*/
- public function userRequestsAddressbookUsingTheAPI($user, $addressBook) {
+ public function userRequestsAddressBookUsingTheAPI($user, $addressBook) {
$davUrl = $this->featureContext->getBaseUrl()
. '/remote.php/dav/addressbooks/users/' . $addressBook;
@@ -109,7 +109,7 @@ public function userRequestsAddressbookUsingTheAPI($user, $addressBook) {
}
/**
- * @Given user :user has successfully created an addressbook named :addressBook
+ * @Given user :user has successfully created an address book named :addressBook
*
* @param string $user
* @param string $addressBook
@@ -117,7 +117,7 @@ public function userRequestsAddressbookUsingTheAPI($user, $addressBook) {
* @return void
* @throws \Exception
*/
- public function userHasCreatedAnAddressbookNamed($user, $addressBook) {
+ public function userHasCreatedAnAddressBookNamed($user, $addressBook) {
$davUrl = $this->featureContext->getBaseUrl()
. '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook;
diff --git a/tests/acceptance/features/bootstrap/Checksums.php b/tests/acceptance/features/bootstrap/Checksums.php
index 8bcdd2d3705b..876866bdb296 100644
--- a/tests/acceptance/features/bootstrap/Checksums.php
+++ b/tests/acceptance/features/bootstrap/Checksums.php
@@ -141,6 +141,8 @@ public function theHeaderChecksumShouldMatch($checksum) {
* @Then the webdav checksum should be empty
*
* @return void
+ * @throws \Sabre\Xml\ParseException
+ * @throws \Exception
*/
public function theWebdavChecksumShouldBeEmpty() {
$service = new Sabre\Xml\Service();
@@ -163,6 +165,7 @@ public function theWebdavChecksumShouldBeEmpty() {
* @Then the OC-Checksum header should not be there
*
* @return void
+ * @throws \Exception
*/
public function theOcChecksumHeaderShouldNotBeThere() {
if ($this->response->hasHeader('OC-Checksum')) {
diff --git a/tests/acceptance/features/bootstrap/CommandLine.php b/tests/acceptance/features/bootstrap/CommandLine.php
index 4549ee8af286..481c785d39fa 100644
--- a/tests/acceptance/features/bootstrap/CommandLine.php
+++ b/tests/acceptance/features/bootstrap/CommandLine.php
@@ -130,6 +130,7 @@ public function findLines($input, $text) {
* @Then /^the command should have been successful$/
*
* @return void
+ * @throws \Exception
*/
public function theCommandShouldHaveBeenSuccessful() {
$exceptions = $this->findExceptions();
@@ -153,7 +154,7 @@ public function theCommandShouldHaveBeenSuccessful() {
* @param int $exitCode
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theCommandFailedWithExitCode($exitCode) {
if ($this->lastCode !== (int)$exitCode) {
@@ -170,7 +171,7 @@ public function theCommandFailedWithExitCode($exitCode) {
* @param string $exceptionText
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theCommandFailedWithExceptionText($exceptionText) {
$exceptions = $this->findExceptions();
@@ -192,7 +193,7 @@ public function theCommandFailedWithExceptionText($exceptionText) {
* @param string $text
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theCommandOutputContainsTheText($text) {
$lines = $this->findLines($this->lastStdOut, $text);
@@ -210,7 +211,7 @@ public function theCommandOutputContainsTheText($text) {
* @param string $text
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theCommandErrorOutputContainsTheText($text) {
$lines = $this->findLines($this->lastStdErr, $text);
@@ -289,6 +290,7 @@ public function transferringOwnership($user1, $user2) {
* @Given /^the administrator has successfully recreated the encryption masterkey$/
*
* @return void
+ * @throws \Exception
*/
public function recreateMasterKeyUsingOccCommand() {
$this->runOcc(['encryption:recreate-master-key', '-y']);
diff --git a/tests/acceptance/features/bootstrap/Comments.php b/tests/acceptance/features/bootstrap/Comments.php
index 77ba21de7170..7fddba2f41a3 100644
--- a/tests/acceptance/features/bootstrap/Comments.php
+++ b/tests/acceptance/features/bootstrap/Comments.php
@@ -20,6 +20,7 @@
*
*/
+use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Exception\BadResponseException;
require __DIR__ . '/../../../../lib/composer/autoload.php';
@@ -39,18 +40,16 @@ trait Comments {
private $lastFileId;
/**
- * @When /^user "([^"]*)" comments with content "([^"]*)" on (file|folder) "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has commented with content "([^"]*)" on (file|folder) "([^"]*)"$/
+ * @When /^user "([^"]*)" comments with content "([^"]*)" on (?:file|folder) "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has commented with content "([^"]*)" on (?:file|folder) "([^"]*)"$/
*
* @param string $user
* @param string $content
- * @param string $type
* @param string $path
*
* @return void
- * @throws \Exception
*/
- public function userCommentsWithContentOnEntry($user, $content, $type, $path) {
+ public function userCommentsWithContentOnEntry($user, $content, $path) {
$fileId = $this->getFileIdForPath($user, $path);
$this->lastFileId = $fileId;
$commentsPath = '/comments/files/' . $fileId . '/';
@@ -81,16 +80,15 @@ public function userCommentsWithContentOnEntry($user, $content, $type, $path) {
}
/**
- * @Then /^user "([^"]*)" should have the following comments on (file|folder) "([^"]*)"$/
+ * @Then /^user "([^"]*)" should have the following comments on (?:file|folder) "([^"]*)"$/
*
* @param string $user
- * @param string $type
* @param string $path
- * @param \Behat\Gherkin\Node\TableNode|null $expectedElements
+ * @param TableNode|null $expectedElements
*
* @return void
*/
- public function checkComments($user, $type, $path, $expectedElements) {
+ public function checkComments($user, $path, $expectedElements) {
$fileId = $this->getFileIdForPath($user, $path);
$commentsPath = '/comments/files/' . $fileId . '/';
$properties = '2000';
@@ -106,7 +104,7 @@ public function checkComments($user, $type, $path, $expectedElements) {
);
}
- if ($expectedElements instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($expectedElements instanceof TableNode) {
$elementRows = $expectedElements->getRows();
foreach ($elementRows as $expectedElement) {
$commentFound = false;
@@ -126,16 +124,15 @@ public function checkComments($user, $type, $path, $expectedElements) {
}
/**
- * @Then /^user "([^"]*)" should have (\d+) comments on (file|folder) "([^"]*)"$/
+ * @Then /^user "([^"]*)" should have (\d+) comments on (?:file|folder) "([^"]*)"$/
*
* @param string $user
* @param string $numberOfComments
- * @param string $type
* @param string $path
*
* @return void
*/
- public function checkNumberOfComments($user, $numberOfComments, $type, $path) {
+ public function checkNumberOfComments($user, $numberOfComments, $path) {
$fileId = $this->getFileIdForPath($user, $path);
$commentsPath = '/comments/files/' . $fileId . '/';
$properties = '2000';
diff --git a/tests/acceptance/features/bootstrap/EmailContext.php b/tests/acceptance/features/bootstrap/EmailContext.php
index d20936044ab8..37147354e6e3 100644
--- a/tests/acceptance/features/bootstrap/EmailContext.php
+++ b/tests/acceptance/features/bootstrap/EmailContext.php
@@ -22,7 +22,6 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
-use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\PyStringNode;
use TestHelpers\EmailHelper;
@@ -48,6 +47,7 @@ public function getMailhogUrl() {
* @param PyStringNode $content
*
* @return void
+ * @throws \Exception
*/
public function assertThatEmailContains($address, PyStringNode $content) {
$expectedContent = \str_replace("\r\n", "\n", $content->getRaw());
@@ -60,11 +60,9 @@ public function assertThatEmailContains($address, PyStringNode $content) {
/**
* @BeforeScenario @mailhog
*
- * @param BeforeScenarioScope $scope
- *
* @return void
*/
- public function setUpScenario(BeforeScenarioScope $scope) {
+ public function setUpScenario() {
$this->mailhogUrl = EmailHelper::getMailhogUrl();
$this->clearMailHogMessages();
}
diff --git a/tests/acceptance/features/bootstrap/Logging.php b/tests/acceptance/features/bootstrap/Logging.php
index 25f87220999c..1321ca6c58d0 100644
--- a/tests/acceptance/features/bootstrap/Logging.php
+++ b/tests/acceptance/features/bootstrap/Logging.php
@@ -44,6 +44,7 @@ trait Logging {
* |user|app|method|message|
*
* @return void
+ * @throws \Exception
*/
public function theLastLinesOfTheLogFileShouldContainEntriesWithTheseAttributes(
TableNode $expectedLogEntries
@@ -93,6 +94,7 @@ public function theLastLinesOfTheLogFileShouldContainEntriesWithTheseAttributes(
* |user|app|method|message|
*
* @return void
+ * @throws \Exception
*/
public function theLogFileShouldNotContainAnyLogEntriesWithTheseAttributes(
TableNode $logEntriesExpectedNotToExist
@@ -131,6 +133,7 @@ public function theLogFileShouldNotContainAnyLogEntriesWithTheseAttributes(
* @param string $logLevel (debug|info|warning|error)
*
* @return void
+ * @throws \Exception
*/
public function owncloudLogLevelIsSetTo($logLevel) {
LoggingHelper::setLogLevel($logLevel);
@@ -143,6 +146,7 @@ public function owncloudLogLevelIsSetTo($logLevel) {
* @param string $backend (owncloud|syslog|errorlog)
*
* @return void
+ * @throws \Exception
*/
public function owncloudLogBackendIsSetTo($backend) {
LoggingHelper::setLogBackend($backend);
@@ -155,6 +159,7 @@ public function owncloudLogBackendIsSetTo($backend) {
* @param string $timezone
*
* @return void
+ * @throws \Exception
*/
public function owncloudLogTimezoneIsSetTo($timezone) {
LoggingHelper::setLogTimezone($timezone);
@@ -165,6 +170,7 @@ public function owncloudLogTimezoneIsSetTo($timezone) {
* @Given the owncloud log has been cleared
*
* @return void
+ * @throws \Exception
*/
public function theOwncloudLogIsCleared() {
LoggingHelper::clearLogFile();
@@ -176,6 +182,7 @@ public function theOwncloudLogIsCleared() {
* @BeforeScenario
*
* @return void
+ * @throws \Exception
*/
public function setUpScenarioLogging() {
$this->oldLogLevel = LoggingHelper::getLogLevel();
@@ -189,6 +196,7 @@ public function setUpScenarioLogging() {
* @AfterScenario
*
* @return void
+ * @throws \Exception
*/
public function tearDownScenarioLogging() {
if ($this->oldLogLevel !== null
diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php
index 4fd4fb7b0a91..d6661308ffac 100644
--- a/tests/acceptance/features/bootstrap/Provisioning.php
+++ b/tests/acceptance/features/bootstrap/Provisioning.php
@@ -104,7 +104,7 @@ public function getCreatedUserDisplayNames() {
* @param string $username
*
* @return string password
- * @throws Exception
+ * @throws \Exception
*/
public function getUserPassword($username) {
if ($username === $this->getAdminUsername()) {
@@ -128,7 +128,7 @@ public function getUserPassword($username) {
* @param string $username
*
* @return boolean
- * @throws Exception
+ * @throws \Exception
*/
public function theUserShouldExist($username) {
if (\array_key_exists($username, $this->createdUsers)) {
@@ -149,7 +149,7 @@ public function theUserShouldExist($username) {
* @param string $groupname
*
* @return boolean
- * @throws Exception
+ * @throws \Exception
*/
public function theGroupShouldExist($groupname) {
if (\array_key_exists($groupname, $this->createdGroups)) {
@@ -170,7 +170,7 @@ public function theGroupShouldExist($groupname) {
* @param string $groupname
*
* @return boolean
- * @throws Exception
+ * @throws \Exception
*/
public function theGroupShouldBeAbleToBeDeleted($groupname) {
if (\array_key_exists($groupname, $this->createdGroups)) {
@@ -193,6 +193,7 @@ public function theGroupShouldBeAbleToBeDeleted($groupname) {
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function adminCreatesUserUsingTheAPI($user) {
if (!$this->userExists($user)) {
@@ -212,6 +213,7 @@ public function adminCreatesUserUsingTheAPI($user) {
* @param TableNode $table
*
* @return void
+ * @throws \Exception
*/
public function theseUsersHaveBeenCreated($doNotInitialize, TableNode $table) {
foreach ($table as $row) {
@@ -243,7 +245,6 @@ public function theseUsersHaveBeenCreated($doNotInitialize, TableNode $table) {
* @return void
*/
public function theAppHasBeenDisabled($app) {
- $client = new Client();
$fullUrl = $this->getBaseUrl()
. "/ocs/v{$this->apiVersion}.php/cloud/apps/" . $app;
$options = [];
@@ -300,6 +301,7 @@ public function theAdministratorCreatesUserPasswordGroupUsingTheApi(
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function theAdminDeletesTheUserUsingAPI($user) {
$this->deleteTheUserUsingTheAPI($user);
@@ -313,6 +315,7 @@ public function theAdminDeletesTheUserUsingAPI($user) {
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function theSubAdminDeletesTheUser($subadmin, $user) {
$this->response = UserHelper::deleteUser(
@@ -390,7 +393,7 @@ public function groupShouldNotExist($group) {
* @param TableNode $table
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theseGroupsShouldNotExist($shouldOrNot, TableNode $table) {
$should = ($shouldOrNot !== "not");
@@ -413,6 +416,7 @@ public function theseGroupsShouldNotExist($shouldOrNot, TableNode $table) {
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function adminDeletesUserUsingTheAPI($user) {
if ($this->userExists($user)) {
@@ -515,7 +519,7 @@ public function rememberThatUserIsNotExpectedToExist($user) {
* @param string $method how to create the user api|occ
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
private function createUser(
$user, $password, $displayName = null, $email = null, $initialize = true,
@@ -578,6 +582,7 @@ private function createUser(
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function deleteUser($user) {
$this->deleteTheUserUsingTheAPI($user);
@@ -592,6 +597,7 @@ public function deleteUser($user) {
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function cleanupGroup($group) {
try {
@@ -710,6 +716,7 @@ public function userBelongsToGroup($user, $group) {
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function adminAddsUserToGroupUsingTheAPI($user, $group) {
if (!$this->userBelongsToGroup($user, $group)) {
@@ -727,7 +734,7 @@ public function adminAddsUserToGroupUsingTheAPI($user, $group) {
* @param string $method how to add the user to the group api|occ
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function userHasBeenAddedToGroup($user, $group, $method = null) {
if ($method === null && \getenv("TEST_EXTERNAL_USER_BACKENDS") === "true") {
@@ -817,6 +824,7 @@ public function rememberThatGroupIsNotExpectedToExist($group) {
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function adminCreatesGroupUsingTheAPI($group) {
if (!$this->groupExists($group)) {
@@ -832,6 +840,7 @@ public function adminCreatesGroupUsingTheAPI($group) {
* @param TableNode $table
*
* @return void
+ * @throws \Exception
*/
public function theseGroupsHaveBeenCreated(TableNode $table) {
foreach ($table as $row) {
@@ -864,7 +873,7 @@ public function adminSendsGroupCreationRequestUsingTheAPI($group) {
* @param string $method how to create the group api|occ
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
private function createTheGroup($group, $method = null) {
if ($method === null && \getenv("TEST_EXTERNAL_USER_BACKENDS") === "true") {
@@ -940,6 +949,7 @@ public function adminDisablesUserUsingTheAPI($user) {
* @param string $user
*
* @return void
+ * @throws \Exception
*/
public function deleteTheUserUsingTheAPI($user) {
// Always try to delete the user
@@ -973,6 +983,7 @@ public function deleteTheUserUsingTheAPI($user) {
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function groupHasBeenDeletedUsingTheAPI($group) {
if ($this->groupExists($group)) {
@@ -987,6 +998,7 @@ public function groupHasBeenDeletedUsingTheAPI($group) {
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function deleteTheGroupUsingTheAPI($group) {
$this->response = UserHelper::deleteGroup(
@@ -1133,12 +1145,12 @@ public function adminMakesUserNotSubadminOfGroupUsingTheAPI($user, $group) {
/**
* @Then /^the users returned by the API should be$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $usersList
+ * @param TableNode $usersList
*
* @return void
*/
public function theUsersShouldBe($usersList) {
- if ($usersList instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($usersList instanceof TableNode) {
$users = $usersList->getRows();
$usersSimplified = $this->simplifyArray($users);
$respondedArray = $this->getArrayOfUsersResponded($this->response);
@@ -1151,12 +1163,12 @@ public function theUsersShouldBe($usersList) {
/**
* @Then /^the groups returned by the API should be$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $groupsList
+ * @param TableNode $groupsList
*
* @return void
*/
public function theGroupsShouldBe($groupsList) {
- if ($groupsList instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($groupsList instanceof TableNode) {
$groups = $groupsList->getRows();
$groupsSimplified = $this->simplifyArray($groups);
$respondedArray = $this->getArrayOfGroupsResponded($this->response);
@@ -1203,7 +1215,7 @@ public function theUsersReturnedByTheApiShouldNotInclude($user) {
}
/**
- * @param \Behat\Gherkin\Node\TableNode|null $groupsOrUsersList
+ * @param TableNode|null $groupsOrUsersList
*
* @return void
*/
@@ -1219,7 +1231,7 @@ public function checkSubadminGroupsOrUsersTable($groupsOrUsersList) {
/**
* @Then /^the subadmin groups returned by the API should be$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $groupsList
+ * @param TableNode|null $groupsList
*
* @return void
*/
@@ -1230,7 +1242,7 @@ public function theSubadminGroupsShouldBe($groupsList) {
/**
* @Then /^the subadmin users returned by the API should be$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $usersList
+ * @param TableNode|null $usersList
*
* @return void
*/
@@ -1241,7 +1253,7 @@ public function theSubadminUsersShouldBe($usersList) {
/**
* @Then /^the apps returned by the API should include$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $appList
+ * @param TableNode|null $appList
*
* @return void
*/
@@ -1494,7 +1506,7 @@ public function adminGivesUnlimitedQuotaToUserUsingTheAPI($user) {
*
* @param string $user
*
- * @return void
+ * @return string
*/
public function getUserHome($user) {
$fullUrl = $this->getBaseUrl()
@@ -1509,7 +1521,7 @@ public function getUserHome($user) {
/**
* @Then /^the user attributes returned by the API should include$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -1533,7 +1545,7 @@ public function checkUserAttributes($body) {
* @Then the attributes of user :user returned by the API should include
*
* @param string $user
- * @param \Behat\Gherkin\Node\TableNode $body
+ * @param TableNode $body
*
* @return void
*/
@@ -1571,11 +1583,25 @@ public function theListOfUsersReturnedByTheApiShouldBeEmpty() {
);
}
+ /**
+ * @Then /^the list of groups returned by the API should be empty$/
+ *
+ * @return void
+ */
+ public function theListOfGroupsReturnedByTheApiShouldBeEmpty() {
+ $groupsList = $this->response->xml()->data[0]->groups[0];
+ PHPUnit_Framework_Assert::assertEmpty(
+ $groupsList,
+ "Groups list is not empty but it should be empty"
+ );
+ }
+
/**
* @BeforeScenario
* @AfterScenario
*
* @return void
+ * @throws \Exception
*/
public function cleanupUsers() {
$this->deleteTokenAuthEnforcedAfterScenario();
@@ -1596,6 +1622,7 @@ public function cleanupUsers() {
* @AfterScenario
*
* @return void
+ * @throws \Exception
*/
public function cleanupGroups() {
$this->deleteTokenAuthEnforcedAfterScenario();
@@ -1638,7 +1665,7 @@ public function restoreDisabledApps() {
/**
* Returns array of enabled apps
*
- * @return void
+ * @return array
*/
public function getEnabledApps() {
$fullUrl = $this->getBaseUrl() . "/ocs/v2.php/cloud/apps?filter=enabled";
@@ -1652,7 +1679,7 @@ public function getEnabledApps() {
/**
* Returns array of disabled apps
*
- * @return void
+ * @return array
*/
public function getDisabledApps() {
$fullUrl = $this->getBaseUrl() . "/ocs/v2.php/cloud/apps?filter=disabled";
diff --git a/tests/acceptance/features/bootstrap/ShareesContext.php b/tests/acceptance/features/bootstrap/ShareesContext.php
index bf6d82bad427..58f64f11a145 100644
--- a/tests/acceptance/features/bootstrap/ShareesContext.php
+++ b/tests/acceptance/features/bootstrap/ShareesContext.php
@@ -24,6 +24,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
+use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Message\ResponseInterface;
require_once 'bootstrap.php';
@@ -37,7 +38,7 @@ class ShareesContext implements Context, SnippetAcceptingContext {
/**
* @When /^the user gets the sharees using the API with parameters$/
*
- * @param \Behat\Gherkin\Node\TableNode $body
+ * @param TableNode $body
*
* @return void
*/
@@ -49,13 +50,13 @@ public function theUserGetsTheShareesWithParameters($body) {
* @When /^user "([^"]*)" gets the sharees using the API with parameters$/
*
* @param string $user
- * @param \Behat\Gherkin\Node\TableNode $body
+ * @param TableNode $body
*
* @return void
*/
public function userGetsTheShareesWithParameters($user, $body) {
$url = '/apps/files_sharing/api/v1/sharees';
- if ($body instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($body instanceof TableNode) {
$parameters = [];
foreach ($body->getRowsHash() as $key => $value) {
$parameters[] = $key . '=' . $value;
@@ -74,7 +75,7 @@ public function userGetsTheShareesWithParameters($user, $body) {
* @Then /^the "([^"]*)" sharees returned should be$/
*
* @param string $shareeType
- * @param \Behat\Gherkin\Node\TableNode $shareesList
+ * @param TableNode $shareesList
*
* @return void
*/
diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php
index 9726c3ca7c41..2b6e3e13f5d6 100644
--- a/tests/acceptance/features/bootstrap/Sharing.php
+++ b/tests/acceptance/features/bootstrap/Sharing.php
@@ -22,6 +22,7 @@
*
*/
+use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\BadResponseException;
use TestHelpers\SharingHelper;
@@ -79,7 +80,7 @@ public function getLastShareTime() {
* @Given /^user "([^"]*)" has created a share with settings$/
*
* @param string $user
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -90,7 +91,7 @@ public function userCreatesAShareWithSettings($user, $body) {
$options = [];
$options['auth'] = $this->getAuthOptionForUser($user);
- if ($body instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($body instanceof TableNode) {
$fd = $body->getRowsHash();
if (\array_key_exists('expireDate', $fd)) {
$dateModification = $fd['expireDate'];
@@ -113,7 +114,7 @@ public function userCreatesAShareWithSettings($user, $body) {
/**
* @When /^the user creates a share using the API with settings$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -124,7 +125,7 @@ public function theUserCreatesAShareWithSettings($body) {
/**
* @Given /^the user has created a share with settings$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -320,7 +321,6 @@ private function checkUserDownload($url, $options, $mimeType) {
// read everything
$buf .= $body->read(8192);
}
- $mimeType = 'text/plain';
if ($mimeType !== null) {
$finfo = new finfo;
PHPUnit_Framework_Assert::assertEquals(
@@ -513,7 +513,7 @@ public function theUserAddsExpirationDateToLastShare() {
* @When /^the user updates the last share using the API with$/
* @Given /^the user has updated the last share with$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -526,7 +526,7 @@ public function theUserUpdatesTheLastShareWith($body) {
* @Given /^user "([^"]*)" has updated the last share with$/
*
* @param string $user
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
@@ -538,7 +538,7 @@ public function userUpdatesTheLastShareWith($user, $body) {
$options = [];
$options['auth'] = $this->getAuthOptionForUser($user);
- if ($body instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($body instanceof TableNode) {
$fd = $body->getRowsHash();
if (\array_key_exists('expireDate', $fd)) {
$dateModification = $fd['expireDate'];
@@ -753,20 +753,18 @@ public function isUserOrGroupInSharedData($userOrGroup, $permissions = null) {
}
/**
- * @When /^user "([^"]*)" shares (file|folder|entry) "([^"]*)" with user "([^"]*)"( with permissions ([\d]*))? using the API$/
- * @Given /^user "([^"]*)" has shared (file|folder|entry) "([^"]*)" with user "([^"]*)"( with permissions ([\d]*))?$/
+ * @When /^user "([^"]*)" shares (?:file|folder|entry) "([^"]*)" with user "([^"]*)"(?: with permissions ([\d]*))? using the API$/
+ * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with user "([^"]*)"(?: with permissions ([\d]*))?$/
*
* @param string $user1
- * @param string $entry unused
* @param string $filepath
* @param string $user2
- * @param null $withPerms unused
* @param int $permissions
*
* @return void
*/
public function userSharesFileWithUserUsingTheAPI(
- $user1, $entry, $filepath, $user2, $withPerms = null, $permissions = null
+ $user1, $filepath, $user2, $permissions = null
) {
$fullUrl = $this->getBaseUrl()
. "/ocs/v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares" . "?path=$filepath";
@@ -797,40 +795,36 @@ public function userSharesFileWithUserUsingTheAPI(
}
/**
- * @When /^the user shares (file|folder|entry) "([^"]*)" with group "([^"]*)"( with permissions ([\d]*))? using the API$/
- * @Given /^the user has shared (file|folder|entry) "([^"]*)" with group "([^"]*)"( with permissions ([\d]*))?$/
+ * @When /^the user shares (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions ([\d]*))? using the API$/
+ * @Given /^the user has shared (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions ([\d]*))?$/
*
- * @param string $entry unused
* @param string $filepath
* @param string $group
- * @param null $withPerms unused
* @param int $permissions
*
* @return void
*/
public function theUserSharesFileWithGroupUsingTheAPI(
- $entry, $filepath, $group, $withPerms = null, $permissions = null
+ $filepath, $group, $permissions = null
) {
$this->userSharesFileWithGroupUsingTheAPI(
- $this->currentUser, $entry, $filepath, $group, $withPerms, $permissions
+ $this->currentUser, $filepath, $group, $permissions
);
}
/**
- * @When /^user "([^"]*)" shares (file|folder|entry) "([^"]*)" with group "([^"]*)"( with permissions ([\d]*))? using the API$/
- * @Given /^user "([^"]*)" has shared (file|folder|entry) "([^"]*)" with group "([^"]*)"( with permissions ([\d]*))?$/
+ * @When /^user "([^"]*)" shares (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions ([\d]*))? using the API$/
+ * @Given /^user "([^"]*)" has shared (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions ([\d]*))?$/
*
* @param string $user
- * @param string $entry unused
* @param string $filepath
* @param string $group
- * @param null $withPerms unused
* @param int $permissions
*
* @return void
*/
public function userSharesFileWithGroupUsingTheAPI(
- $user, $entry, $filepath, $group, $withPerms = null, $permissions = null
+ $user, $filepath, $group, $permissions = null
) {
$fullUrl = $this->getBaseUrl()
. "/ocs/v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares" . "?path=$filepath";
@@ -945,12 +939,12 @@ public function checkingTheResponseEntriesCount($count) {
/**
* @Then /^the share fields of the last share should include$/
*
- * @param \Behat\Gherkin\Node\TableNode|null $body
+ * @param TableNode|null $body
*
* @return void
*/
public function checkShareFields($body) {
- if ($body instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($body instanceof TableNode) {
$fd = $body->getRowsHash();
foreach ($fd as $field => $value) {
@@ -994,7 +988,7 @@ public function checkShareFields($body) {
* @param string $user
* @param string $fileName
*
- * @throws Exception
+ * @throws \Exception
* @return void
*/
public function userRemovesAllSharesFromTheFileNamed($user, $fileName) {
@@ -1049,6 +1043,7 @@ public function rememberLastShareId() {
* @Then the share ids should match
*
* @return void
+ * @throws \Exception
*/
public function shareIdsShouldMatch() {
if ($this->savedShareId !== $this->lastShareData['data']['id']) {
@@ -1080,25 +1075,24 @@ public function getShares($user, $path) {
}
/**
- * @Then /^as user "([^"]*)" the public shares of (file|folder) "([^"]*)" should be$/
+ * @Then /^as user "([^"]*)" the public shares of (?:file|folder) "([^"]*)" should be$/
*
* @param string $user
- * @param string $type
* @param string $path
- * @param \Behat\Gherkin\Node\TableNode|null $TableNode
+ * @param TableNode|null $TableNode
*
- * @return int|void
+ * @return void
*/
- public function checkPublicShares($user, $type, $path, $TableNode) {
+ public function checkPublicShares($user, $path, $TableNode) {
$dataResponded = $this->getShares($user, $path);
- if ($TableNode instanceof \Behat\Gherkin\Node\TableNode) {
+ if ($TableNode instanceof TableNode) {
$elementRows = $TableNode->getRows();
if ($elementRows[0][0] === '') {
//It shouldn't have public shares
PHPUnit_Framework_Assert::assertEquals(\count($dataResponded), 0);
- return 0;
+ return;
}
foreach ($elementRows as $expectedElementsArray) {
@@ -1144,18 +1138,17 @@ public function getPublicShareIDByName($user, $path, $name) {
}
/**
- * @When /^user "([^"]*)" deletes public share named "([^"]*)" in (file|folder) "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has deleted public share named "([^"]*)" in (file|folder) "([^"]*)"$/
+ * @When /^user "([^"]*)" deletes public share named "([^"]*)" in (?:file|folder) "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has deleted public share named "([^"]*)" in (?:file|folder) "([^"]*)"$/
*
* @param string $user
* @param string $name
- * @param string $type unused
* @param string $path
*
* @return void
*/
public function userDeletesPublicShareNamedUsingTheAPI(
- $user, $name, $type, $path
+ $user, $name, $path
) {
$share_id = $this->getPublicShareIDByName($user, $path, $name);
$url = "/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
diff --git a/tests/acceptance/features/bootstrap/Tags.php b/tests/acceptance/features/bootstrap/Tags.php
index dfe7f812e43b..64a360400799 100644
--- a/tests/acceptance/features/bootstrap/Tags.php
+++ b/tests/acceptance/features/bootstrap/Tags.php
@@ -70,6 +70,7 @@ private function createTag(
* @param string $type
*
* @return void
+ * @throws \Exception
*/
private function assertTypeOfTag($tagData, $type) {
$userAttributes = TagsHelper::validateTypeOfTag($type);
@@ -210,7 +211,7 @@ public function tagShouldNotExistForUser($tagDisplayName, $user) {
* @param string $tagDisplayName
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theUserCanAssignTheTag(
$user, $shouldOrNot, $type, $tagDisplayName
@@ -239,6 +240,7 @@ public function theUserCanAssignTheTag(
* @param string $groups list of groups separated by "|"
*
* @return void
+ * @throws \Exception
*/
public function theTagHasGroup($type, $tagName, $groups) {
$tagData = $this->requestTagByDisplayName(
@@ -432,35 +434,34 @@ private function requestTagsForFile($user, $fileName, $sharingUser = null) {
}
/**
- * @When /^user "([^"]*)" adds the tag "([^"]*)" to "([^"]*)" (shared|owned) by "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has added the tag "([^"]*)" to "([^"]*)" (shared|owned) by "([^"]*)"$/
+ * @When /^user "([^"]*)" adds the tag "([^"]*)" to "([^"]*)" (?:shared|owned) by "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has added the tag "([^"]*)" to "([^"]*)" (?:shared|owned) by "([^"]*)"$/
*
* @param string $taggingUser
* @param string $tagName
* @param string $fileName
- * @param string $sharedOrOwnedBy unused
* @param string $sharingUser
*
* @return void
*/
public function addsTheTagToSharedBy(
- $taggingUser, $tagName, $fileName, $sharedOrOwnedBy, $sharingUser
+ $taggingUser, $tagName, $fileName, $sharingUser
) {
$this->tag($taggingUser, $tagName, $fileName, $sharingUser);
}
/**
- * @Then /^(?:file|folder|entry) "([^"]*)" (shared|owned) by "([^"]*)" should have the following tags$/
+ * @Then /^(?:file|folder|entry) "([^"]*)" (?:shared|owned) by "([^"]*)" should have the following tags$/
*
* @param string $fileName
- * @param string $sharedOrOwnedBy unused
* @param string $sharingUser
* @param TableNode $table
*
* @return bool
+ * @throws \Exception
*/
public function sharedByHasTheFollowingTags(
- $fileName, $sharedOrOwnedBy, $sharingUser, TableNode $table
+ $fileName, $sharingUser, TableNode $table
) {
$tagList = $this->requestTagsForFile($sharingUser, $fileName);
//Check if we are looking for no tags
@@ -489,20 +490,19 @@ public function sharedByHasTheFollowingTags(
}
/**
- * @Then file :fileName shared by :sharingUser should have the following tags for :user
+ * @Then file :fileName should have the following tags for user :user
*
* @param string $fileName
- * @param string $sharingUser unused
* @param string $user
* @param TableNode $table
*
* @return void
* @throws \Exception
*/
- public function sharedByHasTheFollowingTagsFor(
- $fileName, $sharingUser, $user, TableNode $table
+ public function fileHasTheFollowingTagsForUser(
+ $fileName, $user, TableNode $table
) {
- $this->sharedByHasTheFollowingTags($fileName, 'shared', $user, $table);
+ $this->sharedByHasTheFollowingTags($fileName, $user, $table);
}
/**
diff --git a/tests/acceptance/features/bootstrap/Trashbin.php b/tests/acceptance/features/bootstrap/Trashbin.php
index 3cb605593096..3b0ca9129023 100644
--- a/tests/acceptance/features/bootstrap/Trashbin.php
+++ b/tests/acceptance/features/bootstrap/Trashbin.php
@@ -36,7 +36,7 @@ trait Trashbin {
*/
public function emptyTrashbin($user) {
$body = new \Behat\Gherkin\Node\TableNode(
- [['allfiles', 'true'], ['dir', '%2F']]
+ [['allfiles', 'true'], ['dir', '/']]
);
$this->sendingToWithDirectUrl(
$user, 'POST', "/index.php/apps/files_trashbin/ajax/delete.php", $body
@@ -74,15 +74,14 @@ public function listTrashbinFolder($user, $path) {
}
/**
- * @Then /^as "([^"]*)" the (file|folder|entry) "([^"]*)" should exist in trash$/
+ * @Then /^as "([^"]*)" the (?:file|folder|entry) "([^"]*)" should exist in trash$/
*
* @param string $user
- * @param string $entryText unused
* @param string $path
*
* @return void
*/
- public function asTheFileOrFolderExistsInTrash($user, $entryText, $path) {
+ public function asTheFileOrFolderExistsInTrash($user, $path) {
$path = \trim($path, '/');
$sections = \explode('/', $path, 2);
@@ -189,16 +188,15 @@ private function restoreElement($user, $originalPath) {
}
/**
- * @When /^user "([^"]*)" restores the (file|folder|entry) with original path "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has restored the (file|folder|entry) with original path "([^"]*)"$/
+ * @When /^user "([^"]*)" restores the (?:file|folder|entry) with original path "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has restored the (?:file|folder|entry) with original path "([^"]*)"$/
*
* @param string $user
- * @param string $entryText unused
* @param string $originalPath
*
* @return void
*/
- public function elementInTrashIsRestored($user, $entryText, $originalPath) {
+ public function elementInTrashIsRestored($user, $originalPath) {
$this->restoreElement($user, $originalPath);
PHPUnit_Framework_Assert::assertFalse(
$this->isInTrash($user, $originalPath),
@@ -207,16 +205,15 @@ public function elementInTrashIsRestored($user, $entryText, $originalPath) {
}
/**
- * @Then /^as "([^"]*)" the (file|folder|entry) with original path "([^"]*)" should exist in trash$/
+ * @Then /^as "([^"]*)" the (?:file|folder|entry) with original path "([^"]*)" should exist in trash$/
*
* @param string $user
- * @param string $entryText unused
* @param string $originalPath
*
* @return void
*/
public function elementIsInTrashCheckingOriginalPath(
- $user, $entryText, $originalPath
+ $user, $originalPath
) {
PHPUnit_Framework_Assert::assertTrue(
$this->isInTrash($user, $originalPath),
@@ -225,19 +222,18 @@ public function elementIsInTrashCheckingOriginalPath(
}
/**
- * @Then /^as "([^"]*)" the (file|folder|entry) with original path "([^"]*)" should not exist in trash$/
+ * @Then /^as "([^"]*)" the (?:file|folder|entry) with original path "([^"]*)" should not exist in trash$/
*
* @param string $user
- * @param string $entryText
* @param string $originalPath
*
* @return void
*/
public function elementIsNotInTrashCheckingOriginalPath(
- $user, $entryText, $originalPath
+ $user, $originalPath
) {
PHPUnit_Framework_Assert::assertFalse(
- $this->isInTrash($user, $entryText, $originalPath),
+ $this->isInTrash($user, $originalPath),
"File previously located at $originalPath was found in the trashbin"
);
}
diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php
index dedd0f9703ac..8e593d482ba5 100644
--- a/tests/acceptance/features/bootstrap/WebDav.php
+++ b/tests/acceptance/features/bootstrap/WebDav.php
@@ -22,6 +22,7 @@
use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Client as GClient;
use GuzzleHttp\Exception\BadResponseException;
+use GuzzleHttp\Message\FutureResponse;
use GuzzleHttp\Message\ResponseInterface;
use GuzzleHttp\Stream\StreamInterface;
use Sabre\DAV\Client as SClient;
@@ -179,7 +180,7 @@ private function getDavPath($for = null) {
* @param string|null $requestBody
* @param string|null $davPathVersion
*
- * @return \GuzzleHttp\Message\FutureResponse|ResponseInterface|NULL
+ * @return FutureResponse|ResponseInterface|NULL
*/
public function makeDavRequest(
$user,
@@ -208,17 +209,16 @@ public function makeDavRequest(
}
/**
- * @Given /^user "([^"]*)" has moved (file|folder|entry) "([^"]*)" to "([^"]*)"$/
+ * @Given /^user "([^"]*)" has moved (?:file|folder|entry) "([^"]*)" to "([^"]*)"$/
*
* @param string $user
- * @param string $entry unused
* @param string $fileSource
* @param string $fileDestination
*
* @return void
*/
public function userHasMovedFile(
- $user, $entry, $fileSource, $fileDestination
+ $user, $fileSource, $fileDestination
) {
$fullUrl = $this->getBaseUrl() . '/' . $this->getDavFilesPath($user);
$headers['Destination'] = $fullUrl . $fileDestination;
@@ -231,17 +231,16 @@ public function userHasMovedFile(
}
/**
- * @When /^user "([^"]*)" moves (file|folder|entry) "([^"]*)" to "([^"]*)" using the API$/
+ * @When /^user "([^"]*)" moves (?:file|folder|entry) "([^"]*)" to "([^"]*)" using the API$/
*
* @param string $user
- * @param string $entry unused
* @param string $fileSource
* @param string $fileDestination
*
* @return void
*/
public function userMovesFileUsingTheAPI(
- $user, $entry, $fileSource, $fileDestination
+ $user, $fileSource, $fileDestination
) {
$fullUrl = $this->getBaseUrl() . '/' . $this->getDavFilesPath($user);
$headers['Destination'] = $fullUrl . $fileDestination;
@@ -518,17 +517,16 @@ public function downloadedContentShouldStartWith($start) {
}
/**
- * @When /^user "([^"]*)" gets the following properties of (file|folder|entry) "([^"]*)" using the API$/
+ * @When /^user "([^"]*)" gets the following properties of (?:file|folder|entry) "([^"]*)" using the API$/
*
* @param string $user
- * @param string $elementType unused
* @param string $path
* @param TableNode|null $propertiesTable
*
* @return void
*/
public function userGetsPropertiesOfFolder(
- $user, $elementType, $path, $propertiesTable
+ $user, $path, $propertiesTable
) {
$properties = null;
if ($propertiesTable instanceof TableNode) {
@@ -549,6 +547,7 @@ public function userGetsPropertiesOfFolder(
* @param string $path
*
* @return void
+ * @throws \Sabre\HTTP\ClientHttpException
*/
public function userGetsPropertiesOfFile($user, $propertyName, $path) {
$client = $this->getSabreClient($user);
@@ -562,19 +561,20 @@ public function userGetsPropertiesOfFile($user, $propertyName, $path) {
}
/**
- * @When /^user "([^"]*)" sets property "([^"]*)" of (file|folder|entry) "([^"]*)" to "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has set property "([^"]*)" of (file|folder|entry) "([^"]*)" to "([^"]*)"$/
+ * @When /^user "([^"]*)" sets property "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has set property "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)"$/
*
* @param string $user
* @param string $propertyName
- * @param string $elementType unused
* @param string $path
* @param string $propertyValue
*
* @return void
+ * @throws \Sabre\HTTP\ClientException
+ * @throws \Sabre\HTTP\ClientHttpException
*/
public function userHasSetPropertyOfEntryTo(
- $user, $propertyName, $elementType, $path, $propertyValue
+ $user, $propertyName, $path, $propertyValue
) {
$client = $this->getSabreClient($user);
$properties = [
@@ -588,13 +588,11 @@ public function userHasSetPropertyOfEntryTo(
*
* @param string $propertyName
* @param string $propertyValue
- * @param null $table unused
- *
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theResponseShouldContainACustomPropertyWithValue(
- $propertyName, $propertyValue, $table=null
+ $propertyName, $propertyValue
) {
$keys = $this->response;
if (!\array_key_exists($propertyName, $keys)) {
@@ -615,7 +613,7 @@ public function theResponseShouldContainACustomPropertyWithValue(
* @param string $path
*
* @return array
- * @throws Exception
+ * @throws \Exception
*/
public function asTheFileOrFolderShouldNotExist($user, $entry, $path) {
$client = $this->getSabreClient($user);
@@ -641,7 +639,7 @@ public function asTheFileOrFolderShouldNotExist($user, $entry, $path) {
* @param string $path
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function asTheFileOrFolderShouldExist($user, $entry, $path) {
$this->response = $this->listFolder($user, $path, 0);
@@ -658,7 +656,7 @@ public function asTheFileOrFolderShouldExist($user, $entry, $path) {
* @param string $key
* @param string $expectedValue
*
- * @return int
+ * @return void
* @throws \Exception
*/
public function theSingleResponseShouldContainAPropertyWithValue(
@@ -676,7 +674,7 @@ public function theSingleResponseShouldContainAPropertyWithValue(
* @param string $expectedValue
* @param string $altExpectedValue
*
- * @return int
+ * @return void
* @throws \Exception
*/
public function theSingleResponseShouldContainAPropertyWithValueAndAlternative(
@@ -701,7 +699,7 @@ public function theSingleResponseShouldContainAPropertyWithValueAndAlternative(
if ($expectedValue === "a_comment_url") {
if (\preg_match("#^/remote.php/dav/comments/files/([0-9]+)$#", $value)) {
- return 0;
+ return;
} else {
throw new \Exception(
"Property \"$key\" found with value \"$value\", expected \"$expectedValue\""
@@ -743,9 +741,7 @@ public function theSingleResponseShouldContainAPropertyWithValueLike(
}
}
- if (\preg_match($regex, $value)) {
- return 0;
- } else {
+ if (!\preg_match($regex, $value)) {
throw new \Exception(
"Property \"$key\" found with value \"$value\", expected \"$regex\""
);
@@ -758,7 +754,7 @@ public function theSingleResponseShouldContainAPropertyWithValueLike(
* @param TableNode $table
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function theResponseShouldContainAShareTypesPropertyWith($table) {
$keys = $this->response;
@@ -880,7 +876,7 @@ public function listVersionFolder(
*
* @return void
*/
- public function theVersionFolderOfFilehouldContainElements(
+ public function theVersionFolderOfFileShouldContainElements(
$path, $user, $count
) {
$fileId = $this->getFileIdForPath($user, $path);
@@ -1302,6 +1298,7 @@ public function theHTTPStatusCodeOfAllUploadResponsesShouldBe($statusCode) {
* @param string $destination
*
* @return void
+ * @throws \Exception
*/
public function filesUploadedToWithAllMechanismsShouldExist(
$user, $destination
@@ -1357,6 +1354,10 @@ public function userUploadsAFileWithContentTo(
// 4xx and 5xx responses cause an exception
$this->response = $e->getResponse();
}
+
+ // Return an invalid file id so that any later step that tries to use it
+ // will fail.
+ return "";
}
/**
@@ -1397,7 +1398,7 @@ public function userUploadsAFileWithChecksumAndContentTo(
* @return void
*/
public function fileHasBeenDeleted($file, $user) {
- $this->userDeletesFile($user, 'file', $file);
+ $this->userDeletesFile($user, $file);
}
/**
@@ -1405,34 +1406,32 @@ public function fileHasBeenDeleted($file, $user) {
* entries with the same timestamp. Only use this step to avoid the problem
* in core issue 23151 when wanting to demonstrate other correct behavior
*
- * @When /^user "([^"]*)" waits and deletes (file|folder) "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has waited and deleted (file|folder) "([^"]*)"$/
+ * @When /^user "([^"]*)" waits and deletes (?:file|folder) "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has waited and deleted (?:file|folder) "([^"]*)"$/
*
* @param string $user
- * @param string $type unused
* @param string $file
*
* @return void
*/
- public function userWaitsAndDeletesFile($user, $type, $file) {
+ public function userWaitsAndDeletesFile($user, $file) {
// prevent creating two files in the trashbin with the same timestamp
// which is based on seconds. e.g. deleting a/file.txt and b/file.txt
// might result in a name clash file.txt.d1456657282 in the trashbin
\sleep(1);
- $this->userDeletesFile($user, $type, $file);
+ $this->userDeletesFile($user, $file);
}
/**
- * @When /^user "([^"]*)" deletes (file|folder) "([^"]*)" using the API$/
- * @Given /^user "([^"]*)" has deleted (file|folder) "([^"]*)"$/
+ * @When /^user "([^"]*)" deletes (?:file|folder) "([^"]*)" using the API$/
+ * @Given /^user "([^"]*)" has deleted (?:file|folder) "([^"]*)"$/
*
* @param string $user
- * @param string $type unused
* @param string $file
*
* @return void
*/
- public function userDeletesFile($user, $type, $file) {
+ public function userDeletesFile($user, $file) {
try {
$this->response = $this->makeDavRequest($user, 'DELETE', $file, []);
} catch (BadResponseException $e) {
@@ -1633,10 +1632,12 @@ private function encodePath($path) {
* @param string $path
*
* @return void
+ * @throws \Sabre\HTTP\ClientException
+ * @throws \Sabre\HTTP\ClientHttpException
*/
public function userFavoritesElement($user, $path) {
$this->response = $this->changeFavStateOfAnElement(
- $user, $path, 1, 0, null
+ $user, $path, 1
);
}
@@ -1648,10 +1649,12 @@ public function userFavoritesElement($user, $path) {
* @param string $path
*
* @return void
+ * @throws \Sabre\HTTP\ClientException
+ * @throws \Sabre\HTTP\ClientHttpException
*/
public function userUnfavoritesElement($user, $path) {
$this->response = $this->changeFavStateOfAnElement(
- $user, $path, 0, 0, null
+ $user, $path, 0
);
}
@@ -1661,13 +1664,13 @@ public function userUnfavoritesElement($user, $path) {
* @param string $user
* @param string $path
* @param int $favOrUnfav 1 = favorite, 0 = unfavorite
- * @param int $folderDepth requires 1 to see elements without children
- * @param array|null $properties
*
* @return bool
+ * @throws \Sabre\HTTP\ClientException
+ * @throws \Sabre\HTTP\ClientHttpException
*/
public function changeFavStateOfAnElement(
- $user, $path, $favOrUnfav, $folderDepth, $properties = null
+ $user, $path, $favOrUnfav
) {
$settings = [
'baseUri' => $this->getBaseUrl() . '/',
@@ -1676,14 +1679,12 @@ public function changeFavStateOfAnElement(
'authType' => SClient::AUTH_BASIC
];
$client = new SClient($settings);
- if (!$properties) {
- $properties = [
- '{http://owncloud.org/ns}favorite' => $favOrUnfav
- ];
- }
+ $properties = [
+ '{http://owncloud.org/ns}favorite' => $favOrUnfav
+ ];
$response = $client->proppatch(
- $this->getDavFilesPath($user) . $path, $properties, $folderDepth
+ $this->getDavFilesPath($user) . $path, $properties
);
return $response;
}
@@ -1700,7 +1701,7 @@ public function changeFavStateOfAnElement(
public function userStoresEtagOfElement($user, $path) {
$propertiesTable = new TableNode([['{DAV:}getetag']]);
$this->userGetsPropertiesOfFolder(
- $user, null, $path, $propertiesTable
+ $user, $path, $propertiesTable
);
$pathETAG[$path] = $this->response['{DAV:}getetag'];
$this->storedETAG[$user] = $pathETAG;
@@ -1717,7 +1718,7 @@ public function userStoresEtagOfElement($user, $path) {
public function etagOfElementOfUserShouldNotHaveChanged($path, $user) {
$propertiesTable = new TableNode([['{DAV:}getetag']]);
$this->userGetsPropertiesOfFolder(
- $user, null, $path, $propertiesTable
+ $user, $path, $propertiesTable
);
PHPUnit_Framework_Assert::assertEquals(
$this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]
@@ -1735,7 +1736,7 @@ public function etagOfElementOfUserShouldNotHaveChanged($path, $user) {
public function etagOfElementOfUserShouldHaveChanged($path, $user) {
$propertiesTable = new TableNode([['{DAV:}getetag']]);
$this->userGetsPropertiesOfFolder(
- $user, null, $path, $propertiesTable
+ $user, $path, $propertiesTable
);
PHPUnit_Framework_Assert::assertNotEquals(
$this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]
@@ -1762,6 +1763,7 @@ public function connectingToDavEndpoint() {
* @Then there should be no duplicate headers
*
* @return void
+ * @throws \Exception
*/
public function thereAreNoDuplicateHeaders() {
$headers = $this->response->getHeaders();
@@ -1843,7 +1845,7 @@ public function userDeletesEverythingInFolder($user, $folder) {
if (\substr($element, 0, \strlen($davPrefix)) == $davPrefix) {
$element = \substr($element, \strlen($davPrefix));
}
- $this->userDeletesFile($user, "element", $element);
+ $this->userDeletesFile($user, $element);
}
}
}
diff --git a/tests/acceptance/features/bootstrap/WebUIFilesContext.php b/tests/acceptance/features/bootstrap/WebUIFilesContext.php
index 1de231870a37..7148c52443af 100644
--- a/tests/acceptance/features/bootstrap/WebUIFilesContext.php
+++ b/tests/acceptance/features/bootstrap/WebUIFilesContext.php
@@ -167,6 +167,7 @@ public function resetFilesContext() {
* @Given the user has browsed to the files page
*
* @return void
+ * @throws \Exception
*/
public function theUserBrowsesToTheFilesPage() {
$this->filesPage->setPagePath(
@@ -185,6 +186,7 @@ public function theUserBrowsesToTheFilesPage() {
* @Given the user has browsed to the trashbin page
*
* @return void
+ * @throws \Exception
*/
public function theUserBrowsesToTheTrashbinPage() {
$this->trashbinPage->setPagePath(
@@ -197,12 +199,13 @@ public function theUserBrowsesToTheTrashbinPage() {
$this->webUIGeneralContext->setCurrentPageObject($this->trashbinPage);
}
}
-
+
/**
* @When the user browses to the favorites page
* @Given the user has browsed to the favorites page
*
* @return void
+ * @throws \Exception
*/
public function theUserBrowsesToTheFavoritesPage() {
$this->favoritesPage->setPagePath(
@@ -221,6 +224,7 @@ public function theUserBrowsesToTheFavoritesPage() {
* @Given the user has browsed to the shared-with-you page
*
* @return void
+ * @throws \Exception
*/
public function theUserBrowsesToTheSharedWithYouPage() {
$this->sharedWithYouPage->setPagePath(
@@ -240,10 +244,11 @@ public function theUserBrowsesToTheSharedWithYouPage() {
* @When /^the user creates a folder with the (invalid|)\s?name ((?:'[^']*')|(?:"[^"]*")) using the webUI$/
*
* @param string $invalid contains "invalid"
- * if the folder creation is expected to fail
+ * if the folder creation is expected to fail
* @param string $name enclosed in single or double quotes
*
* @return void
+ * @throws \Exception
*/
public function theUserCreatesAFolderUsingTheWebUI($invalid, $name) {
// The capturing group of the regex always includes the quotes at each
@@ -270,6 +275,7 @@ public function theUserCreatesAFolderUsingTheWebUI($invalid, $name) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function createAFolder($name) {
$session = $this->getSession();
@@ -284,6 +290,7 @@ public function createAFolder($name) {
* table headings: must be: |name-parts |
*
* @return void
+ * @throws \Exception
*/
public function theUserCreatesTheFollowingFolderUsingTheWebUI(
TableNode $namePartsTable
@@ -331,6 +338,7 @@ public function thereShouldBeCountFilesFoldersListedOnTheWebUI($count) {
* @Given so many files\/folders have been created that they do not fit in one browser page
*
* @return void
+ * @throws \Exception
*/
public function theListOfFilesFoldersDoesNotFitInOneBrowserPage() {
$windowHeight = $this->filesPage->getWindowHeight(
@@ -364,6 +372,7 @@ public function theListOfFilesFoldersDoesNotFitInOneBrowserPage() {
* @param string $toName
*
* @return void
+ * @throws \Exception
*/
public function theUserRenamesTheFileFolderToUsingTheWebUI(
$fromName, $toName
@@ -381,6 +390,7 @@ public function theUserRenamesTheFileFolderToUsingTheWebUI(
* |from-name-parts |to-name-parts |
*
* @return void
+ * @throws \Exception
*/
public function theUserRenamesTheFollowingFileFolderToUsingTheWebUI(
TableNode $namePartsTable
@@ -408,6 +418,7 @@ public function theUserRenamesTheFollowingFileFolderToUsingTheWebUI(
* @param TableNode $table
*
* @return void
+ * @throws \Exception
*/
public function theUserRenamesTheFileToOneOfTheseNamesUsingTheWebUI(
$fromName, TableNode $table
@@ -426,7 +437,7 @@ public function theUserRenamesTheFileToOneOfTheseNamesUsingTheWebUI(
* @param bool $expectToDeleteFile if true, then the caller expects that the file can be deleted
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function deleteTheFileUsingTheWebUI($name, $expectToDeleteFile = true) {
$pageObject = $this->getCurrentPageObject();
@@ -454,6 +465,7 @@ public function deleteTheFileUsingTheWebUI($name, $expectToDeleteFile = true) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserDeletesTheFileUsingTheWebUI($name) {
$this->deleteTheFileUsingTheWebUI($name);
@@ -467,6 +479,7 @@ public function theUserDeletesTheFileUsingTheWebUI($name) {
* table headings: must be: |name-parts |
*
* @return void
+ * @throws \Exception
*/
public function theUserDeletesTheFollowingFileUsingTheWebUI(
TableNode $namePartsTable
@@ -486,6 +499,7 @@ public function theUserDeletesTheFollowingFileUsingTheWebUI(
* @param TableNode $filesTable table headings: must be: |name|
*
* @return void
+ * @throws \Exception
*/
public function theFollowingFilesFoldersHaveBeenDeleted(TableNode $filesTable) {
foreach ($filesTable as $file) {
@@ -532,6 +546,7 @@ public function theFollowingFilesFoldersHaveBeenDeleted(TableNode $filesTable) {
* table headings: must be: |name|
*
* @return void
+ * @throws \Exception
*/
public function theUserDeletesTheFollowingElementsUsingTheWebUI(
TableNode $table
@@ -589,6 +604,7 @@ public function theUserMovesTheFollowingFileFolderUsingTheWebUI(
* table headings: must be: |name|
*
* @return void
+ * @throws \Exception
*/
public function theUserBatchMovesTheseFilesIntoTheFolderUsingTheWebUI(
$folderName, TableNode $files
@@ -606,6 +622,7 @@ public function theUserBatchMovesTheseFilesIntoTheFolderUsingTheWebUI(
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserUploadsOverwritingTheFileUsingTheWebUI($name) {
$this->theUserUploadsTheFileUsingTheWebUI($name);
@@ -620,6 +637,7 @@ public function theUserUploadsOverwritingTheFileUsingTheWebUI($name) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserUploadsOverwritingTheFileUsingTheWebUIRetry($name) {
$previousNotificationsCount = 0;
@@ -668,6 +686,7 @@ public function theUserUploadsOverwritingTheFileUsingTheWebUIRetry($name) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserUploadsTheFileKeepingNewExistingUsingTheWebUI($name) {
$this->theUserUploadsTheFileUsingTheWebUI($name);
@@ -695,6 +714,7 @@ public function theUserUploadsTheFileUsingTheWebUI($name) {
* @param string $choice
*
* @return void
+ * @throws \Exception
*/
public function choiceInUploadConflictDialogWebUI($choice) {
$dialogs = $this->filesPage->getOcDialogs();
@@ -748,6 +768,7 @@ public function theUserChoosesToInTheUploadDialog($label) {
* @param string $shouldOrNot
*
* @return void
+ * @throws \Exception
*/
public function theDeletedMovedElementsShouldBeListedOnTheWebUI($shouldOrNot) {
if ($this->deletedElementsTable !== null) {
@@ -772,6 +793,7 @@ public function theDeletedMovedElementsShouldBeListedOnTheWebUI($shouldOrNot) {
* @param string $shouldOrNot
*
* @return void
+ * @throws \Exception
*/
public function theDeletedMovedElementsShouldBeListedOnTheWebUIAfterPageReload(
$shouldOrNot
@@ -784,6 +806,7 @@ public function theDeletedMovedElementsShouldBeListedOnTheWebUIAfterPageReload(
* @Then the deleted elements should be listed in the trashbin on the webUI
*
* @return void
+ * @throws \Exception
*/
public function theDeletedElementsShouldBeListedInTheTrashbinOnTheWebUI() {
$this->theUserBrowsesToTheTrashbinPage();
@@ -803,6 +826,7 @@ public function theDeletedElementsShouldBeListedInTheTrashbinOnTheWebUI() {
* table headings: must be: |name|
*
* @return void
+ * @throws \Exception
*/
public function theUserBatchDeletesTheseFilesUsingTheWebUI(TableNode $files) {
$this->deletedElementsTable = $files;
@@ -842,6 +866,7 @@ public function theUserBatchRestoresTheMarkedFilesUsingTheWebUI() {
* table headings: must be: |name|
*
* @return void
+ * @throws \Exception
*/
public function theUserMarksTheseFilesForBatchActionUsingTheWebUI(
TableNode $files
@@ -876,6 +901,7 @@ public function theUserMarksAllFilesForBatchActionUsingTheWebUI() {
* @param string $name enclosed in single or double quotes
*
* @return void
+ * @throws \Exception
*/
public function theUserOpensTheFolderNamedUsingTheWebUI(
$typeOfFilesPage, $fileOrFolder, $name
@@ -893,6 +919,7 @@ public function theUserOpensTheFolderNamedUsingTheWebUI(
* @param string|array $name
*
* @return void
+ * @throws \Exception
*/
public function theUserOpensTheFolderUsingTheWebUI(
$typeOfFilesPage, $fileOrFolder, $name
@@ -944,6 +971,7 @@ public function theFolderShouldBeEmptyOnTheWebUI($shouldOrNot) {
* @param string $shouldOrNot
*
* @return void
+ * @throws \Exception
*/
public function theFolderShouldBeEmptyOnTheWebUIAfterAPageReload($shouldOrNot) {
$this->webUIGeneralContext->theUserReloadsTheCurrentPageOfTheWebUI();
@@ -959,6 +987,7 @@ public function theFolderShouldBeEmptyOnTheWebUIAfterAPageReload($shouldOrNot) {
* @param string $folder
*
* @return void
+ * @throws \Exception
*/
public function theFileFolderShouldBeListedOnTheWebUI(
$name, $shouldOrNot, $typeOfFilesPage = "", $folder = ""
@@ -984,6 +1013,7 @@ public function theFileFolderShouldBeListedOnTheWebUI(
* @param string $folder
*
* @return void
+ * @throws \Exception
*/
public function checkIfFileFolderIsListedOnTheWebUI(
$name, $shouldOrNot, $typeOfFilesPage = "", $folder = ""
@@ -1077,6 +1107,7 @@ public function checkIfFileFolderIsListedOnTheWebUI(
* @param string $folderName
*
* @return void
+ * @throws \Exception
*/
public function theMovedElementsShouldBeListedInTheFolderOnTheWebUI(
$shouldOrNot, $folderName
@@ -1094,6 +1125,7 @@ public function theMovedElementsShouldBeListedInTheFolderOnTheWebUI(
* table headings: must be: | item-name-parts | folder-name-parts |
*
* @return void
+ * @throws \Exception
*/
public function theFollowingFileFolderShouldBeListedInTheFollowingFolderOnTheWebUI(
$shouldOrNot, TableNode $namePartsTable
@@ -1123,6 +1155,7 @@ public function theFollowingFileFolderShouldBeListedInTheFollowingFolderOnTheWeb
* table headings: must be: |name-parts |
*
* @return void
+ * @throws \Exception
*/
public function theFollowingFileFolderShouldBeListedOnTheWebUI(
$shouldOrNot,
@@ -1207,6 +1240,7 @@ public function folderInputFieldTooltipTextShouldBeDisplayedOnTheWebUI(
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function itShouldNotBePossibleToDeleteUsingTheWebUI($name) {
try {
@@ -1266,6 +1300,7 @@ public function theFilesActionMenuShouldBeCompletelyVisibleAfterOpeningItUsingTh
* @param string $originalFile enclosed in single or double quotes
*
* @return void
+ * @throws \Exception
*/
public function theContentOfShouldBeTheSameAsTheOriginal(
$remoteFile, $remoteServer, $shouldOrNot, $originalFile
@@ -1290,6 +1325,7 @@ public function theContentOfShouldBeTheSameAsTheOriginal(
* @param string $localFile enclosed in single or double quotes
*
* @return void
+ * @throws \Exception
*/
public function theContentOfShouldBeTheSameAsTheLocal(
$remoteFile, $remoteServer, $shouldOrNot, $localFile
@@ -1312,6 +1348,7 @@ public function theContentOfShouldBeTheSameAsTheLocal(
* @param string $remoteServer
*
* @return void
+ * @throws \Exception
*/
public function theContentOfShouldNotHaveChanged($fileName, $remoteServer) {
$checkOnRemoteServer = ($remoteServer === 'on the remote server');
@@ -1337,6 +1374,7 @@ public function theContentOfShouldNotHaveChanged($fileName, $remoteServer) {
* @param string $fileOrFolderName
*
* @return void
+ * @throws \Exception
*/
public function theUserMarksTheFileAsFavoriteUsingTheWebUI($fileOrFolderName) {
$fileRow = $this->filesPage->findFileRowByName(
@@ -1345,13 +1383,14 @@ public function theUserMarksTheFileAsFavoriteUsingTheWebUI($fileOrFolderName) {
$fileRow->markAsFavorite();
$this->filesPage->waitTillFileRowsAreReady($this->getSession());
}
-
+
/**
* @Then the file/folder :fileOrFolderName should be marked as favorite on the webUI
*
* @param string $fileOrFolderName
*
* @return void
+ * @throws \Exception
*/
public function theFileShouldBeMarkedAsFavoriteOnTheWebUI($fileOrFolderName) {
$fileRow = $this->filesPage->findFileRowByName(
@@ -1380,13 +1419,14 @@ public function theUserUnmarksTheFavoritedFileUsingTheWebUI($fileOrFolderName) {
$fileRow->unmarkFavorite();
$this->getCurrentPageObject()->waitTillFileRowsAreReady($this->getSession());
}
-
+
/**
* @Then the file/folder :fileOrFolderName should not be marked as favorite on the webUI
*
* @param string $fileOrFolderName
*
* @return void
+ * @throws \Exception
*/
public function theFolderShouldNotBeMarkedAsFavoriteOnTheWebUI(
$fileOrFolderName
@@ -1414,7 +1454,7 @@ public function theFolderShouldNotBeMarkedAsFavoriteOnTheWebUI(
* @param bool $checkOnRemoteServer if true, then use the remote server to download the file
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
private function assertContentOfRemoteAndLocalFileIsSame(
$remoteFile, $localFile, $shouldBeSame = true, $checkOnRemoteServer = false
diff --git a/tests/acceptance/features/bootstrap/WebUIGeneralContext.php b/tests/acceptance/features/bootstrap/WebUIGeneralContext.php
index 16fbbdb1002c..e9c7d8450743 100644
--- a/tests/acceptance/features/bootstrap/WebUIGeneralContext.php
+++ b/tests/acceptance/features/bootstrap/WebUIGeneralContext.php
@@ -59,7 +59,7 @@ class WebUIGeneralContext extends RawMinkContext implements Context {
/**
*
- * @var Page\OwncloudPage
+ * @var OwncloudPage
*/
private $currentPageObject = null;
@@ -166,6 +166,7 @@ public function setCurrentServer($currentServer) {
* @Given user admin has logged in using the webUI
*
* @return void
+ * @throws \Exception
*/
public function adminLogsInUsingTheWebUI() {
$this->loginPage->open();
@@ -180,7 +181,8 @@ public function adminLogsInUsingTheWebUI() {
* @param string $password
* @param string $target
*
- * @return \Page\OwncloudPage
+ * @return OwncloudPage
+ * @throws \Exception
*/
public function loginAs($username, $password, $target = 'FilesPage') {
$session = $this->getSession();
@@ -200,6 +202,7 @@ public function loginAs($username, $password, $target = 'FilesPage') {
* @Given the user/administrator has logged out of the webUI
*
* @return void
+ * @throws \Exception
*/
public function theUserLogsOutOfTheWebUI() {
$settingsMenu = $this->owncloudPage->openSettingsMenu();
@@ -251,7 +254,7 @@ public function aNotificationShouldBeDisplayedOnTheWebUIWithTheText(
* @param TableNode $table of expected notification text
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function notificationsShouldBeDisplayedOnTheWebUIWithTheText(
$matching, TableNode $table
@@ -422,6 +425,7 @@ public function aFileWithSizeAndNameHasBeenCreatedLocally($size, $name) {
* @Given the user has reloaded the current page of the webUI
*
* @return void
+ * @throws \Exception
*/
public function theUserReloadsTheCurrentPageOfTheWebUI() {
$this->getSession()->reload();
@@ -467,6 +471,7 @@ public function addToSavedCapabilitiesChanges($change) {
* @param BeforeScenarioScope $scope
*
* @return void
+ * @throws \Exception
*/
public function setUpScenario(BeforeScenarioScope $scope) {
// Get the environment
@@ -538,6 +543,7 @@ public function setUpScenario(BeforeScenarioScope $scope) {
* @BeforeScenario @webUI&&@disablePreviews
*
* @return void
+ * @throws \Exception
*/
public function disablePreviewBeforeScenario() {
if ($this->oldPreviewSetting === null) {
@@ -574,6 +580,7 @@ public function getSessionId() {
* @AfterScenario @webUI
*
* @return void
+ * @throws \Exception
*/
public function tearDownSuite() {
AppConfigHelper::modifyServerConfigs(
diff --git a/tests/acceptance/features/bootstrap/WebUILoginContext.php b/tests/acceptance/features/bootstrap/WebUILoginContext.php
index 116eaf15c1ba..b6f71564734f 100644
--- a/tests/acceptance/features/bootstrap/WebUILoginContext.php
+++ b/tests/acceptance/features/bootstrap/WebUILoginContext.php
@@ -77,6 +77,7 @@ public function theUserBrowsesToTheLoginPage() {
* @param string $password
*
* @return void
+ * @throws \Exception
*/
public function theUserRelogsInWithUsernameAndPasswordUsingTheWebUI(
$username, $password
@@ -95,6 +96,7 @@ public function theUserRelogsInWithUsernameAndPasswordUsingTheWebUI(
* @param string $password
*
* @return void
+ * @throws \Exception
*/
public function theUserLogsInWithUsernameAndPasswordUsingTheWebUI(
$username, $password
@@ -110,6 +112,7 @@ public function theUserLogsInWithUsernameAndPasswordUsingTheWebUI(
* @param string $server
*
* @return void
+ * @throws \Exception
*/
public function theUserRelogsInWithUsernameAndPasswordToUsingTheWebUI(
$username, $password, $server
@@ -128,6 +131,7 @@ public function theUserRelogsInWithUsernameAndPasswordToUsingTheWebUI(
* @param string $server
*
* @return void
+ * @throws \Exception
*/
public function theUserLogsInWithUsernameAndPasswordToUsingTheWebUI(
$username, $password, $server
@@ -152,6 +156,7 @@ public function theUserLogsInWithUsernameAndPasswordToUsingTheWebUI(
* @param string $password
*
* @return void
+ * @throws \Exception
*/
public function theUserLogsInWithUsernameAndInvalidPasswordUsingTheWebUI(
$username, $password
@@ -168,6 +173,7 @@ public function theUserLogsInWithUsernameAndInvalidPasswordUsingTheWebUI(
* @param string $page text name of a page that I expect to be taken to
*
* @return void
+ * @throws \Exception
*/
public function theUserLogsInWithUsernameAndPasswordAfterRedirectFromThePage(
$username,
@@ -189,6 +195,7 @@ public function theUserLogsInWithUsernameAndPasswordAfterRedirectFromThePage(
* @param string $password
*
* @return void
+ * @throws \Exception
*/
public function itShouldBePossibleToLogin($shouldOrNot, $username, $password) {
$should = ($shouldOrNot !== "not");
@@ -249,6 +256,7 @@ public function thisMessageShouldBeDisplayed(PyStringNode $string) {
* @param string $emailAddress
*
* @return void
+ * @throws \Exception
*/
public function theUserFollowsThePasswordResetLinkFromTheirEmail($emailAddress) {
$content = EmailHelper::getBodyOfLastEmail(
diff --git a/tests/acceptance/features/bootstrap/WebUIPersonalGeneralSettingsContext.php b/tests/acceptance/features/bootstrap/WebUIPersonalGeneralSettingsContext.php
index 6e5f550c6338..d5f085f42a03 100644
--- a/tests/acceptance/features/bootstrap/WebUIPersonalGeneralSettingsContext.php
+++ b/tests/acceptance/features/bootstrap/WebUIPersonalGeneralSettingsContext.php
@@ -101,13 +101,14 @@ public function theUserChangesTheLanguageToUsingTheWebUI($language) {
$this->getSession()
);
}
-
+
/**
* @When the user changes the password to :newPassword using the webUI
*
* @param string $newPassword
*
* @return void
+ * @throws \Exception
*/
public function theUserChangesThePasswordToUsingTheWebUI($newPassword) {
$username = $this->featureContext->getCurrentUser();
diff --git a/tests/acceptance/features/bootstrap/WebUIPersonalSecuritySettingsContext.php b/tests/acceptance/features/bootstrap/WebUIPersonalSecuritySettingsContext.php
index c701e59468a1..9970a24add2c 100644
--- a/tests/acceptance/features/bootstrap/WebUIPersonalSecuritySettingsContext.php
+++ b/tests/acceptance/features/bootstrap/WebUIPersonalSecuritySettingsContext.php
@@ -85,6 +85,7 @@ public function theUserCreatesANewAppPasswordUsingTheWebUI() {
* @Then the new app should be listed in the App passwords list on the webUI
*
* @return void
+ * @throws \Exception
*/
public function theAppShouldBeListedInTheAppPasswordsListOnTheWebUI() {
$appTr = $this->personalSecuritySettingsPage->getLinkedAppByName(
@@ -132,6 +133,7 @@ public function theUserLogsInWithNewAppPassword($username) {
* @When the user deletes the app password
*
* @return void
+ * @throws \Exception
*/
public function theUserDeletesTheAppPassword() {
$appTr = $this->personalSecuritySettingsPage->getLinkedAppByName(
@@ -150,6 +152,7 @@ public function theUserDeletesTheAppPassword() {
* @param string $username
*
* @return void
+ * @throws \Exception
*/
public function reLogInWithDeletedAppPassword($username) {
$this->webUIGeneralContext->theUserLogsOutOfTheWebUI();
diff --git a/tests/acceptance/features/bootstrap/WebUISharingContext.php b/tests/acceptance/features/bootstrap/WebUISharingContext.php
index ace22df15b73..191ccef52b7f 100644
--- a/tests/acceptance/features/bootstrap/WebUISharingContext.php
+++ b/tests/acceptance/features/bootstrap/WebUISharingContext.php
@@ -118,6 +118,7 @@ private function addToListOfCreatedPublicLinks($name, $url) {
* @param boolean $quiet
*
* @return void
+ * @throws \Exception
*/
public function theUserSharesTheFileFolderWithTheUserUsingTheWebUI(
$folder, $remote, $user, $maxRetries = STANDARDRETRYCOUNT, $quiet = false
@@ -152,6 +153,7 @@ public function theUserSharesTheFileFolderWithTheUserUsingTheWebUI(
* @param string $group
*
* @return void
+ * @throws \Exception
*/
public function theUserSharesTheFileFolderWithTheGroupUsingTheWebUI(
$folder, $group
@@ -176,6 +178,7 @@ public function theUserSharesTheFileFolderWithTheGroupUsingTheWebUI(
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserOpensTheShareDialogForTheFileFolder($name) {
$this->filesPage->waitTillPageIsloaded($this->getSession());
@@ -191,6 +194,7 @@ public function theUserOpensTheShareDialogForTheFileFolder($name) {
* @param string $name
*
* @return void
+ * @throws \Exception
*/
public function theUserCreatesANewPublicLinkForUsingTheWebUI($name) {
$this->theUserCreatesANewPublicLinkForUsingTheWebUIWith($name);
@@ -208,6 +212,7 @@ public function theUserCreatesANewPublicLinkForUsingTheWebUI($name) {
* the way its written in the UI
*
* @return void
+ * @throws \Exception
*/
public function theUserCreatesANewPublicLinkForUsingTheWebUIWith(
$name, TableNode $settings = null
@@ -297,6 +302,7 @@ public function theUserTypesInTheShareWithField($input) {
* touched
*
* @return void
+ * @throws \Exception
*/
public function theUserSetsTheSharingPermissionsOfForOnTheWebUI(
$userName, $fileName, TableNode $permissionsTable
@@ -327,6 +333,7 @@ public function theUserAcceptsTheOfferedRemoteShares() {
* @param string $minCharacters
*
* @return void
+ * @throws \Exception
*/
public function setMinCharactersForAutocomplete($minCharacters) {
if ($this->oldMinCharactersForAutocomplete === null) {
@@ -352,6 +359,7 @@ public function setMinCharactersForAutocomplete($minCharacters) {
* @Given the administrator has allowed http fallback for federation sharing
*
* @return void
+ * @throws \Exception
*/
public function allowHttpFallbackForFedSharing() {
if ($this->oldFedSharingFallbackSetting === null) {
@@ -388,6 +396,7 @@ public function theUserDeclinesTheOfferedRemoteShares() {
* @When the public accesses the last created public link using the webUI
*
* @return void
+ * @throws \Exception
*/
public function thePublicAccessesTheLastCreatedPublicLinkUsingTheWebUI() {
$lastCreatedLink = \end($this->createdPublicLinks);
@@ -410,7 +419,7 @@ public function thePublicAccessesTheLastCreatedPublicLinkUsingTheWebUI() {
* @param string $password
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function thePublicAddsThePublicLinkToUsingTheWebUI(
$server, $username, $password
@@ -528,6 +537,7 @@ public function theAutocompleteListShouldNotBeDisplayed() {
* @param string $sharerName
*
* @return void
+ * @throws \Exception
*/
public function theFileFolderShouldBeMarkedAsSharedBy(
$fileOrFolder, $itemName, $sharedWithGroup, $sharerName
@@ -576,7 +586,7 @@ public function theFileFolderShouldBeMarkedAsSharedBy(
* @param string|null $shareWith
*
* @return void
- * @throws Exception
+ * @throws \Exception
*/
public function itShouldNotBePossibleToShareUsingTheWebUI(
$fileName, $shareWith = null
@@ -593,6 +603,7 @@ public function itShouldNotBePossibleToShareUsingTheWebUI(
'could not find sharing button in fileRow',
'could not share with \'' . $shareWith . '\''
];
+ $foundMessage = false;
foreach ($possibleMessages as $message) {
$foundMessage = \strpos($e->getMessage(), $message);
if ($foundMessage !== false) {
@@ -640,6 +651,7 @@ public function before(BeforeScenarioScope $scope) {
* @AfterScenario @webUI
*
* @return void
+ * @throws \Exception
*/
public function tearDownScenario() {
//TODO make a function that can be used for different settings
diff --git a/tests/acceptance/features/lib/FilesPage.php b/tests/acceptance/features/lib/FilesPage.php
index ac1a83180a03..ed5f5d068f3f 100644
--- a/tests/acceptance/features/lib/FilesPage.php
+++ b/tests/acceptance/features/lib/FilesPage.php
@@ -223,7 +223,7 @@ public function openSharingDialog($fileName, Session $session) {
/**
* closes an open sharing dialog
*
- * @throws \SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException
+ * @throws ElementNotFoundException
* if no sharing dialog is open
* @return void
*/
@@ -322,7 +322,7 @@ public function moveFileTo(
* @param Session $session
*
* @return string
- * @throws \SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException
+ * @throws ElementNotFoundException
*/
public function getTooltipOfFile($fileName, Session $session) {
$fileRow = $this->findFileRowByName($fileName, $session);
diff --git a/tests/acceptance/features/lib/FilesPageElement/FileActionsMenu.php b/tests/acceptance/features/lib/FilesPageElement/FileActionsMenu.php
index 04d4770fb9ea..f4aa4191c895 100644
--- a/tests/acceptance/features/lib/FilesPageElement/FileActionsMenu.php
+++ b/tests/acceptance/features/lib/FilesPageElement/FileActionsMenu.php
@@ -47,7 +47,7 @@ class FileActionsMenu extends OwncloudPage {
* $this->getPage("FilesPageElement\\FileActionsMenu")
* there is no real __construct() that can take arguments
*
- * @param \Behat\Mink\Element\NodeElement $menuElement
+ * @param NodeElement $menuElement
*
* @return void
*/
@@ -102,7 +102,7 @@ public function delete() {
*
* @param string $action
*
- * @return \Behat\Mink\Element\NodeElement
+ * @return NodeElement
* @throws \SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException
*/
public function findButton($action) {
diff --git a/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php b/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php
index a791b274f19e..1379b1295b38 100644
--- a/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php
+++ b/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php
@@ -55,7 +55,7 @@ class EditPublicLinkPopup extends OwncloudPage {
* $this->getPage("FilesPageElement\\SharingDialogElement\\EditPublicLinkPopup")
* there is no real __construct() that can take arguments
*
- * @param \Behat\Mink\Element\NodeElement $popupElement
+ * @param NodeElement $popupElement
*
* @return void
*/
diff --git a/tests/acceptance/features/lib/OwncloudPageElement/OCDialog.php b/tests/acceptance/features/lib/OwncloudPageElement/OCDialog.php
index 54b9114d94df..bf6218c72715 100644
--- a/tests/acceptance/features/lib/OwncloudPageElement/OCDialog.php
+++ b/tests/acceptance/features/lib/OwncloudPageElement/OCDialog.php
@@ -54,7 +54,7 @@ class OCDialog extends OwncloudPage {
* from an other Page Object by $this->getPage("OwncloudPageElement\\OCDialog")
* there is no real __construct() that can take arguments
*
- * @param \Behat\Mink\Element\NodeElement $dialogElement
+ * @param NodeElement $dialogElement
*
* @return void
*/
@@ -65,7 +65,7 @@ public function setElement(NodeElement $dialogElement) {
/**
* returns the Element that was set by setElement()
*
- * @return \Behat\Mink\Element\NodeElement
+ * @return NodeElement
*/
public function getOwnElement() {
return $this->dialogElement;
diff --git a/tests/acceptance/features/lib/PublicLinkFilesPage.php b/tests/acceptance/features/lib/PublicLinkFilesPage.php
index 8510fd253857..e5d3801f1208 100644
--- a/tests/acceptance/features/lib/PublicLinkFilesPage.php
+++ b/tests/acceptance/features/lib/PublicLinkFilesPage.php
@@ -160,7 +160,7 @@ public function moveFileTo(
* @param Session $session
*
* @return string
- * @throws \SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException
+ * @throws ElementNotFoundException
*/
public function getTooltipOfFile($fileName, Session $session) {
throw new \Exception("not implemented");