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
926e2c49
Commit
926e2c49
authored
Mar 30, 2017
by
Sergio Bertolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test about removing specific public link
parent
86e4720c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
tests/integration/features/bootstrap/Sharing.php
tests/integration/features/bootstrap/Sharing.php
+23
-0
tests/integration/features/sharing-v1.feature
tests/integration/features/sharing-v1.feature
+37
-0
No files found.
tests/integration/features/bootstrap/Sharing.php
View file @
926e2c49
...
@@ -565,5 +565,28 @@ trait Sharing {
...
@@ -565,5 +565,28 @@ trait Sharing {
}
}
}
}
public
function
getPublicShareIDByName
(
$user
,
$path
,
$name
)
{
$dataResponded
=
$this
->
getShares
(
$user
,
$path
);
foreach
(
$dataResponded
as
$elementResponded
)
{
if
((
string
)
$elementResponded
->
name
[
0
]
===
$name
){
return
(
int
)
$elementResponded
->
id
[
0
];
}
}
return
null
;
}
/**
* @When /^user "([^"]*)" deletes public share named "([^"]*)" in (file|folder) "([^"]*)"$/
* @param string $user
* @param string $name
* @param string $type
* @param string $path
*/
public
function
deletingPublicShareNamed
(
$user
,
$name
,
$type
,
$path
){
$share_id
=
$this
->
getPublicShareIDByName
(
$user
,
$path
,
$name
);
$url
=
"/apps/files_sharing/api/v
{
$this
->
sharingApiVersion
}
/shares/
$share_id
"
;
$this
->
sendingToWith
(
"DELETE"
,
$url
,
null
);
}
}
}
tests/integration/features/sharing-v1.feature
View file @
926e2c49
...
@@ -1298,3 +1298,40 @@ Feature: sharing
...
@@ -1298,3 +1298,40 @@ Feature: sharing
Then
the HTTP status code should be
"201"
Then
the HTTP status code should be
"201"
And
user
"user0"
checks public shares of file
"/textfile0.txt"
And
user
"user0"
checks public shares of file
"/textfile0.txt"
|
|
|
|
|
|
|
|
Scenario
:
Creating three public shares of a file
Given
user
"user0"
exists
And
As an
"user0"
And
creating a share with
|
path
|
textfile0.txt
|
|
shareType
|
3
|
|
password
|
publicpw
|
|
expireDate
|
+3
days
|
|
permissions
|
1
|
|
name
|
sharedlink1
|
And
the OCS status code should be
"100"
And
the HTTP status code should be
"200"
And
creating a share with
|
path
|
textfile0.txt
|
|
shareType
|
3
|
|
password
|
publicpw
|
|
expireDate
|
+3
days
|
|
permissions
|
1
|
|
name
|
sharedlink2
|
And
the OCS status code should be
"100"
And
the HTTP status code should be
"200"
And
creating a share with
|
path
|
textfile0.txt
|
|
shareType
|
3
|
|
password
|
publicpw
|
|
expireDate
|
+3
days
|
|
permissions
|
1
|
|
name
|
sharedlink3
|
And
the OCS status code should be
"100"
And
the HTTP status code should be
"200"
When
user
"user0"
deletes public share named
"sharedlink2"
in file
"/textfile0.txt"
Then
the OCS status code should be
"100"
And
the HTTP status code should be
"200"
And
user
"user0"
checks public shares of file
"/textfile0.txt"
|
/textfile0.txt
|
1
|
sharedlink1
|
|
/textfile0.txt
|
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