Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
340b5892
Commit
340b5892
authored
Mar 29, 2017
by
Sergio Bertolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making getShares more reusable
parent
6936f45f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
tests/integration/features/bootstrap/Sharing.php
tests/integration/features/bootstrap/Sharing.php
+14
-9
tests/integration/features/sharing-v1.feature
tests/integration/features/sharing-v1.feature
+1
-1
No files found.
tests/integration/features/bootstrap/Sharing.php
View file @
340b5892
...
...
@@ -512,14 +512,8 @@ trait Sharing {
}
}
/**
* @When /^user "([^"]*)" gets shares of (file|folder) "([^"]*)"$/
* @param string $user
* @param string $type
* @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $body
*/
public
function
getShares
(
$user
,
$type
,
$path
,
$TableNode
){
/* Returns shares of a file or folders as an array of elements */
public
function
getShares
(
$user
,
$path
)
{
$fullUrl
=
$this
->
baseUrl
.
"v
{
$this
->
apiVersion
}
.php/apps/files_sharing/api/v
{
$this
->
sharingApiVersion
}
/shares"
;
$fullUrl
=
$fullUrl
.
'?path='
.
$path
;
...
...
@@ -533,7 +527,18 @@ trait Sharing {
}
$this
->
response
=
$client
->
send
(
$client
->
createRequest
(
"GET"
,
$fullUrl
,
$options
));
$dataResponded
=
$this
->
response
->
xml
()
->
data
->
element
;
return
$this
->
response
->
xml
()
->
data
->
element
;
}
/**
* @When /^user "([^"]*)" checks public shares of (file|folder) "([^"]*)"$/
* @param string $user
* @param string $type
* @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $body
*/
public
function
checkPublicShares
(
$user
,
$type
,
$path
,
$TableNode
){
$dataResponded
=
$this
->
getShares
(
$user
,
$path
);
if
(
$TableNode
instanceof
\
Behat\Gherkin\Node\TableNode
)
{
$elementRows
=
$TableNode
->
getRows
();
...
...
tests/integration/features/sharing-v1.feature
View file @
340b5892
...
...
@@ -1198,7 +1198,7 @@ Feature: sharing
|
permissions
|
1
|
Then
the
OCS
status
code
should
be
"100"
And
the HTTP status code should be
"200"
And
user
"user0"
gets
shares of folder
"/FOLDER"
And
user
"user0"
checks public
shares of folder
"/FOLDER"
|
/FOLDER
|
15
|
sharedlink2
|
|
/FOLDER
|
15
|
sharedlink1
|
|
/FOLDER
|
1
|
sharedlink3
|
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment