Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2015-11-30 15:20:05 +0300
committerSergio Bertolin <sbertolin@solidgear.es>2015-11-30 15:20:05 +0300
commit52f6592991956f79724b98036803fde6452e8c66 (patch)
tree3243fe774fccc826272bc528a553d352591cadb1 /build
parent40172e252b9141f76a50413e7ae58ba686bd7c2a (diff)
Making propfinds, having depth in mind and checking it in gherkin description
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/WebDav.php34
-rw-r--r--build/integration/features/sharing-v1.feature8
2 files changed, 25 insertions, 17 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 20c2d0f7994..2bbe44e9c59 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -58,7 +58,8 @@ trait WebDav{
$this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers);
}
- public function listFolder($user, $path){
+ /*Returns the elements of a propfind, $folderDepth requires 1 to see elements without children*/
+ public function listFolder($user, $path, $folderDepth){
$fullUrl = substr($this->baseUrl, 0, -4);
$settings = array(
@@ -66,9 +67,6 @@ trait WebDav{
'userName' => $user,
);
- echo "password del admin: " . $this->adminUser[1] . "\n";
- echo "fullUrl: " . $fullUrl . "\n";
-
if ($user === 'admin') {
$settings['password'] = $this->adminUser[1];
} else {
@@ -78,22 +76,28 @@ trait WebDav{
$client = new SClient($settings);
$response = $client->propfind($this->davPath . "/", array(
- '{DAV:}getetag',
- 1
- ));
-
- print_r($response);
- /*$features = $client->options();
+ '{DAV:}getetag'
+ ), $folderDepth);
- print_r($features);*/
- //return $this->response->xml();
+ return $response;
}
/**
- * @Then /^user "([^"]*)" should see following folders$/
+ * @Then /^user "([^"]*)" should see following elements$/
+ * @param \Behat\Gherkin\Node\TableNode|null $expectedElements
*/
- public function checkList($user){
- $this->listFolder($user, '/');
+ public function checkElementList($user, $expectedElements){
+ $elementList = $this->listFolder($user, '/', 2);
+ if ($expectedElements instanceof \Behat\Gherkin\Node\TableNode) {
+ $elementRows = $expectedElements->getRows();
+ $elementsSimplified = $this->simplifyArray($elementRows);
+ foreach($elementsSimplified as $expectedElement) {
+ $webdavPath = "/" . $this->davPath . $expectedElement;
+ if (!array_key_exists($webdavPath,$elementList)){
+ PHPUnit_Framework_Assert::fail("$webdavPath" . " is not in propfind answer");
+ }
+ }
+ }
}
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature
index fc2da430663..f32e2fa2f3e 100644
--- a/build/integration/features/sharing-v1.feature
+++ b/build/integration/features/sharing-v1.feature
@@ -371,8 +371,12 @@ Feature: sharing
And user "user1" belongs to group "group0"
And file "/PARENT" from user "user0" is shared with user "user1"
When file "/PARENT/CHILD" from user "user0" is shared with group "group0"
- And As an "admin"
- Then user "user1" should see following folders
+ Then user "user1" should see following elements
+ | /FOLDER/ |
+ | /PARENT/ |
+ | /CHILD/ |
+ | /PARENT/parent.txt |
+ | /CHILD/child.txt |
And the HTTP status code should be "200"
Scenario: Delete all group shares