diff options
author | Sergio Bertolín <sbertolin@solidgear.es> | 2016-06-15 10:16:27 +0000 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-06-15 14:21:59 +0200 |
commit | 19b7ae673a8553621b3544aa57f153cf2b7c8ad4 (patch) | |
tree | 04dde487c0aeb0ad3eea6a452bc7d13972a49a88 /build/integration/features/bootstrap/WebDav.php | |
parent | 4232458652d25afecd19783eb62db4e4d9517c5a (diff) | |
download | nextcloud-server-19b7ae673a8553621b3544aa57f153cf2b7c8ad4.tar.gz nextcloud-server-19b7ae673a8553621b3544aa57f153cf2b7c8ad4.zip |
Added unfavoriting tests and some rewording
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 10bd05cbbbf..0abb8667739 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -214,7 +214,7 @@ trait WebDav { } $value = $keys[$key]; - if ($value !== $expectedValue) { + if ($value != $expectedValue) { throw new \Exception("Property \"$key\" found with value \"$value\", expected \"$expectedValue\""); } } @@ -438,12 +438,19 @@ trait WebDav { /** * @When user :user favorites element :path */ - public function userFavoritesFolder($user, $path){ - $this->response = $this->favFolder($user, $path, 0, null); + public function userFavoritesElement($user, $path){ + $this->response = $this->changeFavStateOfAnElement($user, $path, 1, 0, null); + } + + /** + * @When user :user unfavorites element :path + */ + public function userUnfavoritesElement($user, $path){ + $this->response = $this->changeFavStateOfAnElement($user, $path, 0, 0, null); } /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ - public function favFolder($user, $path, $folderDepth, $properties = null){ + public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){ $fullUrl = substr($this->baseUrl, 0, -4); $settings = array( 'baseUri' => $fullUrl, @@ -457,7 +464,7 @@ trait WebDav { $client = new SClient($settings); if (!$properties) { $properties = [ - '{http://owncloud.org/ns}favorite' => 1 + '{http://owncloud.org/ns}favorite' => $favOrUnfav ]; } |