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
4e47895f
Commit
4e47895f
authored
Oct 13, 2016
by
Sergio Bertolin
Browse files
Added functions to check etag of elements
parent
6b8e8edc
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/integration/features/bootstrap/WebDav.php
View file @
4e47895f
...
...
@@ -16,6 +16,8 @@ trait WebDav {
private
$usingOldDavPath
=
true
;
/** @var ResponseInterface */
private
$response
;
/** @var array */
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
]);
}
}
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