Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
39a56c7b
Unverified
Commit
39a56c7b
authored
8 years ago
by
David Toledo
Committed by
Thomas Müller
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added favorites integration tests
parent
5de64324
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/integration/features/bootstrap/WebDav.php
+39
-1
39 additions, 1 deletion
build/integration/features/bootstrap/WebDav.php
build/integration/features/favorites.feature
+23
-0
23 additions, 0 deletions
build/integration/features/favorites.feature
with
62 additions
and
1 deletion
build/integration/features/bootstrap/WebDav.php
+
39
−
1
View file @
39a56c7b
...
@@ -434,5 +434,43 @@ trait WebDav {
...
@@ -434,5 +434,43 @@ trait WebDav {
$this
->
response
=
$ex
->
getResponse
();
$this
->
response
=
$ex
->
getResponse
();
}
}
}
}
}
/*
* @When user "([^"]*)" favorites folder "([^"]*)"
* @param string $user
* @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
*/
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
);
}
/*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/
public
function
favFolder
(
$user
,
$path
,
$folderDepth
,
$properties
=
null
){
$fullUrl
=
substr
(
$this
->
baseUrl
,
0
,
-
4
);
$settings
=
array
(
'baseUri'
=>
$fullUrl
,
'userName'
=>
$user
,
);
if
(
$user
===
'admin'
)
{
$settings
[
'password'
]
=
$this
->
adminUser
[
1
];
}
else
{
$settings
[
'password'
]
=
$this
->
regularUser
;
}
$client
=
new
SClient
(
$settings
);
if
(
!
$properties
)
{
$properties
=
[
'{http://owncloud.org/ns}favorite'
];
}
echo
$properties
,
$response
=
$client
->
proppatch
(
$this
->
davPath
.
'/'
.
ltrim
(
$path
,
'/'
),
$properties
,
$folderDepth
);
return
$response
;
}
}
This diff is collapsed.
Click to expand it.
build/integration/features/favorites.feature
0 → 100644
+
23
−
0
View file @
39a56c7b
Feature
:
favorite
Background
:
Given
using api version
"1"
Scenario
:
Retrieving favorite info of a folder
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
|
{http://owncloud.org/ns}favorite
|
And the single response should contain a property "{http
:
//owncloud.org/ns}favorite"
with
value
"1"
Scenario
:
Retrieving favorite info of a file
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
|
{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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment