diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-03-11 10:23:11 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-03-11 13:59:19 +0100 |
commit | 26e974d85980c44c476af1dfc5b56368f4d98f09 (patch) | |
tree | 54e6cff23f699d686bc1f3bb5cde5322586fd904 /build | |
parent | 62b77d8ed0cc1ea8d328f8c26e2ff69da0171a6d (diff) | |
download | nextcloud-server-26e974d85980c44c476af1dfc5b56368f4d98f09.tar.gz nextcloud-server-26e974d85980c44c476af1dfc5b56368f4d98f09.zip |
Fix inheritance of members
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/CapabilitiesContext.php | 2 | ||||
-rw-r--r-- | build/integration/features/bootstrap/Provisioning.php | 35 | ||||
-rw-r--r-- | build/integration/features/bootstrap/Sharing.php | 7 |
3 files changed, 31 insertions, 13 deletions
diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php index 83d5f5fd2f3..0eb6353a89a 100644 --- a/build/integration/features/bootstrap/CapabilitiesContext.php +++ b/build/integration/features/bootstrap/CapabilitiesContext.php @@ -15,8 +15,6 @@ require __DIR__ . '/../../vendor/autoload.php'; class CapabilitiesContext implements Context, SnippetAcceptingContext { use BasicStructure; - use Provisioning; - use Sharing; /** * @Given /^parameter "([^"]*)" of app "([^"]*)" is set to "([^"]*)"$/ diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php index a3359ac96d6..bf84058c05e 100644 --- a/build/integration/features/bootstrap/Provisioning.php +++ b/build/integration/features/bootstrap/Provisioning.php @@ -1,16 +1,12 @@ <?php -use Behat\Behat\Context\Context; -use Behat\Behat\Context\SnippetAcceptingContext; use GuzzleHttp\Client; use GuzzleHttp\Message\ResponseInterface; require __DIR__ . '/../../vendor/autoload.php'; trait Provisioning { - - /** @var int */ - private $apiVersion = 1; + use BasicStructure; /** @var array */ private $createdUsers = []; @@ -26,6 +22,7 @@ trait Provisioning { /** * @Given /^user "([^"]*)" exists$/ + * @param string $user */ public function assureUserExists($user) { try { @@ -43,6 +40,7 @@ trait Provisioning { /** * @Given /^user "([^"]*)" does not exist$/ + * @param string $user */ public function userDoesNotExist($user) { try { @@ -135,6 +133,8 @@ trait Provisioning { /** * @Then /^check that user "([^"]*)" belongs to group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function checkThatUserBelongsToGroup($user, $group) { $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups"; @@ -160,7 +160,6 @@ trait Provisioning { } $this->response = $client->get($fullUrl, $options); - $groups = array($group); $respondedArray = $this->getArrayOfGroupsResponded($this->response); if (array_key_exists($group, $respondedArray)) { @@ -172,6 +171,8 @@ trait Provisioning { /** * @Given /^user "([^"]*)" belongs to group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function assureUserBelongsToGroup($user, $group){ if (!$this->userBelongsToGroup($user, $group)){ @@ -186,6 +187,8 @@ trait Provisioning { /** * @Given /^user "([^"]*)" does not belong to group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function userDoesNotBelongToGroup($user, $group) { $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups"; @@ -202,8 +205,9 @@ trait Provisioning { PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode()); } - /** + /** * @When /^creating the group "([^"]*)"$/ + * @param string $group */ public function creatingTheGroup($group) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/groups"; @@ -227,6 +231,7 @@ trait Provisioning { /** * @When /^Deleting the user "([^"]*)"$/ + * @param string $user */ public function deletingTheUser($user) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/$user"; @@ -241,6 +246,7 @@ trait Provisioning { /** * @When /^Deleting the group "([^"]*)"$/ + * @param string $group */ public function deletingTheGroup($group) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/groups/$group"; @@ -255,6 +261,8 @@ trait Provisioning { /** * @Given /^Add user "([^"]*)" to the group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function addUserToGroup($user, $group) { $this->userExists($user); @@ -265,6 +273,8 @@ trait Provisioning { /** * @When /^User "([^"]*)" is added to the group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function addingUserToGroup($user, $group) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/$user/groups"; @@ -293,6 +303,7 @@ trait Provisioning { /** * @Given /^group "([^"]*)" exists$/ + * @param string $group */ public function assureGroupExists($group) { try { @@ -309,6 +320,7 @@ trait Provisioning { /** * @Given /^group "([^"]*)" does not exist$/ + * @param string $group */ public function groupDoesNotExist($group) { try { @@ -332,6 +344,8 @@ trait Provisioning { /** * @Given /^user "([^"]*)" is subadmin of group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function userIsSubadminOfGroup($user, $group) { $fullUrl = $this->baseUrl . "v2.php/cloud/groups/$group/subadmins"; @@ -350,6 +364,8 @@ trait Provisioning { /** * @Given /^user "([^"]*)" is not a subadmin of group "([^"]*)"$/ + * @param string $user + * @param string $group */ public function userIsNotSubadminOfGroup($user, $group) { $fullUrl = $this->baseUrl . "v2.php/cloud/groups/$group/subadmins"; @@ -477,6 +493,7 @@ trait Provisioning { /** * @Given /^app "([^"]*)" is disabled$/ + * @param string $app */ public function appIsDisabled($app) { $fullUrl = $this->baseUrl . "v2.php/cloud/apps?filter=disabled"; @@ -494,6 +511,7 @@ trait Provisioning { /** * @Given /^app "([^"]*)" is enabled$/ + * @param string $app */ public function appIsEnabled($app) { $fullUrl = $this->baseUrl . "v2.php/cloud/apps?filter=enabled"; @@ -511,6 +529,8 @@ trait Provisioning { /** * @Given user :user has a quota of :quota + * @param string $user + * @param string $quota */ public function userHasAQuotaOf($user, $quota) { @@ -525,6 +545,7 @@ trait Provisioning { /** * @Given user :user has unlimited quota + * @param string $user */ public function userHasUnlimitedQuota($user) { diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index dede98157d1..5932194d141 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -1,7 +1,5 @@ <?php -use Behat\Behat\Context\Context; -use Behat\Behat\Context\SnippetAcceptingContext; use GuzzleHttp\Client; use GuzzleHttp\Message\ResponseInterface; @@ -10,6 +8,7 @@ require __DIR__ . '/../../vendor/autoload.php'; trait Sharing{ + use Provisioning; /** @var int */ private $sharingApiVersion = 1; @@ -113,7 +112,7 @@ trait Sharing{ * @When /^Adding expiration date to last share$/ */ public function addingExpirationDate() { - $share_id = $this->lastShareData->data[0]->id; + $share_id = (string) $this->lastShareData->data[0]->id; $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id"; $client = new Client(); $options = []; @@ -133,7 +132,7 @@ trait Sharing{ * @param \Behat\Gherkin\Node\TableNode|null $body */ public function updatingLastShare($body) { - $share_id = $this->lastShareData->data[0]->id; + $share_id = (string) $this->lastShareData->data[0]->id; $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id"; $client = new Client(); $options = []; |