Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
6109a19a
Commit
6109a19a
authored
Oct 14, 2016
by
Sergio Bertolín
Committed by
GitHub
Oct 14, 2016
Browse files
Merge pull request #26370 from owncloud/integration_tests_adding_etag_support
Added functions to check etag of elements
parents
371d191e
dff0c25d
Changes
2
Hide whitespace changes
Inline
Side-by-side
build/integration/features/bootstrap/WebDav.php
View file @
6109a19a
...
...
@@ -16,6 +16,8 @@ trait WebDav {
private
$usingOldDavPath
=
true
;
/** @var ResponseInterface */
private
$response
;
/** @var map with user as key and another map as value, which has path as key and etag as value */
private
$storedETAG
=
NULL
;
/**
* @Given /^using dav path "([^"]*)"$/
...
...
@@ -585,4 +587,33 @@ trait WebDav {
return
$response
;
}
/**
* @Given user :user stores etag of element :path
*/
public
function
userStoresEtagOfElement
(
$user
,
$path
){
$propertiesTable
=
new
\
Behat\Gherkin\Node\TableNode
([[
'{DAV:}getetag'
]]);
$this
->
asGetsPropertiesOfFolderWith
(
$user
,
NULL
,
$path
,
$propertiesTable
);
$pathETAG
[
$path
]
=
$this
->
response
[
'{DAV:}getetag'
];
$this
->
storedETAG
[
$user
]
=
$pathETAG
;
print_r
(
$this
->
storedETAG
[
$user
][
$path
]);
}
/**
* @Then etag of element :path of user :user has not changed
*/
public
function
checkIfETAGHasNotChanged
(
$path
,
$user
){
$propertiesTable
=
new
\
Behat\Gherkin\Node\TableNode
([[
'{DAV:}getetag'
]]);
$this
->
asGetsPropertiesOfFolderWith
(
$user
,
NULL
,
$path
,
$propertiesTable
);
PHPUnit_Framework_Assert
::
assertEquals
(
$this
->
response
[
'{DAV:}getetag'
],
$this
->
storedETAG
[
$user
][
$path
]);
}
/**
* @Then etag of element :path of user :user has changed
*/
public
function
checkIfETAGHasChanged
(
$path
,
$user
){
$propertiesTable
=
new
\
Behat\Gherkin\Node\TableNode
([[
'{DAV:}getetag'
]]);
$this
->
asGetsPropertiesOfFolderWith
(
$user
,
NULL
,
$path
,
$propertiesTable
);
PHPUnit_Framework_Assert
::
assertNotEquals
(
$this
->
response
[
'{DAV:}getetag'
],
$this
->
storedETAG
[
$user
][
$path
]);
}
}
build/integration/features/sharing-v1.feature
View file @
6109a19a
...
...
@@ -901,3 +901,18 @@ Feature: sharing
Then
the OCS status code should be
"100"
And
the HTTP status code should be
"200"
Scenario
:
unshare from self
Given
As an
"admin"
And
user
"user0"
exists
And
user
"user1"
exists
And
group
"sharing-group"
exists
And
user
"user0"
belongs to group
"sharing-group"
And
user
"user1"
belongs to group
"sharing-group"
And
file
"/PARENT/parent.txt"
of user
"user0"
is shared with group
"sharing-group"
And
user
"user0"
stores etag of element
"/PARENT"
And
user
"user1"
stores etag of element
"/"
And
As an
"user1"
When
Deleting last share
Then
etag of element
"/"
of user
"user1"
has changed
And
etag of element
"/PARENT"
of user
"user0"
has not changed
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