Skip to content
Snippets Groups Projects
Unverified Commit 42324586 authored by Sergio Bertolín's avatar Sergio Bertolín Committed by Thomas Müller
Browse files

Fixing the tests

parent 39a56c7b
No related branches found
No related tags found
No related merge requests found
...@@ -435,20 +435,11 @@ trait WebDav { ...@@ -435,20 +435,11 @@ trait WebDav {
} }
} }
/* /**
* @When user "([^"]*)" favorites folder "([^"]*)" * @When user :user favorites element :path
* @param string $user
* @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
*/ */
public function userFavoritesFolder($user, $path, $propertiesTable) { public function userFavoritesFolder($user, $path){
$properties = null; $this->response = $this->favFolder($user, $path, 0, null);
if ($propertiesTable instanceof \Behat\Gherkin\Node\TableNode) {
foreach ($propertiesTable->getRows() as $row) {
$properties[] = $row[0];
}
}
$this->response = $this->favFolder($user, $path, 0, $properties);
} }
/*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/
...@@ -466,11 +457,21 @@ trait WebDav { ...@@ -466,11 +457,21 @@ trait WebDav {
$client = new SClient($settings); $client = new SClient($settings);
if (!$properties) { if (!$properties) {
$properties = [ $properties = [
'{http://owncloud.org/ns}favorite' '{http://owncloud.org/ns}favorite' => 1
]; ];
} }
echo $properties,
$response = $client->proppatch($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth); $response = $client->proppatch($this->davPath . '/' . ltrim($path, '/'), $properties, $folderDepth);
return $response; 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);
}
} }
...@@ -6,9 +6,8 @@ Feature: favorite ...@@ -6,9 +6,8 @@ Feature: favorite
Given using dav path "remote.php/webdav" Given using dav path "remote.php/webdav"
And As an "admin" And As an "admin"
And user "user0" exists And user "user0" exists
When user "user0" favorites folder "/" When user "user0" favorites element "/FOLDER"
|{http://owncloud.org/ns}favorite| Then as "user0" gets properties of folder "/FOLDER" with
Then As "user0" gets properties of folder "/" with
|{http://owncloud.org/ns}favorite| |{http://owncloud.org/ns}favorite|
And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1" And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
...@@ -16,8 +15,7 @@ Feature: favorite ...@@ -16,8 +15,7 @@ Feature: favorite
Given using dav path "remote.php/webdav" Given using dav path "remote.php/webdav"
And As an "admin" And As an "admin"
And user "user0" exists And user "user0" exists
When user "user0" favorites folder "/textfile0.txt" When user "user0" favorites element "/textfile0.txt"
|{http://owncloud.org/ns}favorite| Then as "user0" gets properties of file "/textfile0.txt" with
Then As "user0" gets properties of folder "/textfile0.txt" with
|{http://owncloud.org/ns}favorite| |{http://owncloud.org/ns}favorite|
And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1" And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment