]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixing the tests
authorSergio Bertolín <sbertolin@solidgear.es>
Tue, 14 Jun 2016 16:20:40 +0000 (16:20 +0000)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 15 Jun 2016 12:21:59 +0000 (14:21 +0200)
build/integration/features/bootstrap/WebDav.php
build/integration/features/favorites.feature

index a63e2a592183a7a8d19b17f174b39f4010ed47c7..10bd05cbbbf52c640b4f614d8e0eba59a63c2fcd 100644 (file)
@@ -435,20 +435,11 @@ trait WebDav {
                }
        }
 
-       /*
-        * @When user "([^"]*)" favorites folder "([^"]*)"
-        * @param string $user
-        * @param string $path
-        * @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
+       /**
+        * @When user :user favorites element :path
         */
-       public function userFavoritesFolder($user, $path, $propertiesTable) {
-               $properties = null;
-               if ($propertiesTable instanceof \Behat\Gherkin\Node\TableNode) {
-                       foreach ($propertiesTable->getRows() as $row) {
-                               $properties[] = $row[0];
-                       }
-               }
-               $this->response = $this->favFolder($user, $path, 0, $properties);
+       public function userFavoritesFolder($user, $path){
+               $this->response = $this->favFolder($user, $path, 0, null);
        }
 
        /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/
@@ -466,11 +457,21 @@ trait WebDav {
                $client = new SClient($settings);
                if (!$properties) {
                        $properties = [
-                               '{http://owncloud.org/ns}favorite'
+                               '{http://owncloud.org/ns}favorite' => 1
                        ];
                }
-               echo $properties,
+
                $response = $client->proppatch($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth);
                return $response;
        }
+
+       /**
+        * @Then /^as "([^"]*)" gets properties of file "([^"]*)" with$/
+        * @param string $user
+        * @param string $path
+        * @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
+        */
+       public function asGetsPropertiesOfFileWith($user, $path, $propertiesTable) {
+               $this->asGetsPropertiesOfFolderWith($user, $path, $propertiesTable);
+       }
 }
index 4b437d13bd59df1c00286b1bfe9149ebaf0185c3..8025f0834ff2d94793ddb34674bcad3d78e4f9a2 100644 (file)
@@ -6,9 +6,8 @@ Feature: favorite
         Given using dav path "remote.php/webdav"
         And As an "admin"
         And user "user0" exists
-        When user "user0" favorites folder "/"
-            |{http://owncloud.org/ns}favorite|
-        Then As "user0" gets properties of folder "/" with
+        When user "user0" favorites element "/FOLDER"
+        Then as "user0" gets properties of folder "/FOLDER" with
             |{http://owncloud.org/ns}favorite|
         And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
 
@@ -16,8 +15,7 @@ Feature: favorite
         Given using dav path "remote.php/webdav"
         And As an "admin"
         And user "user0" exists
-        When user "user0" favorites folder "/textfile0.txt"
-            |{http://owncloud.org/ns}favorite|
-        Then As "user0" gets properties of folder "/textfile0.txt" with
+        When user "user0" favorites element "/textfile0.txt"
+        Then as "user0" gets properties of file "/textfile0.txt" with
             |{http://owncloud.org/ns}favorite|
         And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
\ No newline at end of file