Added flexibility to properties

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Sergio Bertolin 2016-11-23 17:43:57 +00:00 committed by Lukas Reschke
parent 02de82df91
commit e76732c03a
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 13 additions and 20 deletions

View File

@ -406,32 +406,22 @@ trait WebDav {
return $response;
}
/*Returns the elements of a report command*/
public function reportFolder($user, $path, $properties = null){
/* Returns the elements of a report command
* @param string $user
* @param string $path
* @param string $properties properties which needs to be included in the report
* @param string $filterRules filter-rules to choose what needs to appear in the report
*/
public function reportFolder($user, $path, $properties, $filterRules){
$client = $this->getSabreClient($user);
$body = '<?xml version="1.0" encoding="utf-8" ?>
<oc:filter-files xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns" >
<a:prop>
<oc:id/>
<oc:fileid/>
<oc:permissions/>
<a:getlastmodified/>
<a:getetag/>
<oc:downloadURL/>
<oc:ddC/>
<oc:size/>
<oc:owner-id/>
<oc:owner-display-name/>
<oc:size/>
<oc:checksum />
<oc:tags />
<a:quota-used-bytes/>
<a:quota-available-bytes/>
<oc:favorite/>
' . $properties . '
</a:prop>
<oc:filter-rules>
<oc:favorite>1</oc:favorite>
' . $filterRules . '
</oc:filter-rules>
</oc:filter-files>';
@ -722,7 +712,10 @@ trait WebDav {
* @param \Behat\Gherkin\Node\TableNode|null $expectedElements
*/
public function checkFavoritedElements($user, $folder, $expectedElements){
$elementList = $this->reportFolder($user, $folder);
$elementList = $this->reportFolder($user,
$folder,
'<oc:favorite/>',
'<oc:favorite>1</oc:favorite>');
if ($expectedElements instanceof \Behat\Gherkin\Node\TableNode) {
$elementRows = $expectedElements->getRows();
$elementsSimplified = $this->simplifyArray($elementRows);