summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/FeatureContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'build/integration/features/bootstrap/FeatureContext.php')
-rw-r--r--build/integration/features/bootstrap/FeatureContext.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php
index 69fa018d0e6..4a0299d6e49 100644
--- a/build/integration/features/bootstrap/FeatureContext.php
+++ b/build/integration/features/bootstrap/FeatureContext.php
@@ -672,7 +672,10 @@ class FeatureContext implements Context, SnippetAcceptingContext {
public function isFieldInResponse($field, $content_expected){
$data = $this->response->xml()->data[0];
foreach($data as $element) {
- if ($element->$field == $content_expected){
+ if ($content_expected == "A_NUMBER"){
+ return is_numeric((string)$element->$field);
+ }
+ elseif ($element->$field == $content_expected){
return True;
}
}
@@ -744,10 +747,32 @@ class FeatureContext implements Context, SnippetAcceptingContext {
*/
public function deletingLastShare(){
$share_id = $this->lastShareData->data[0]->id;
- $url = "/apps/files_sharing/api/v{$this->apiVersion}/shares/$share_id";
+ $url = "/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
$this->sendingToWith("DELETE", $url, null);
}
+ /**
+ * @When /^Getting info of last share$/
+ */
+ public function gettingInfoOfLastShare(){
+ $share_id = $this->lastShareData->data[0]->id;
+ $url = "/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
+ $this->sendingToWith("GET", $url, null);
+ }
+
+ /**
+ * @Then /^Share fields of last share match with$/
+ * @param \Behat\Gherkin\Node\TableNode|null $formData
+ */
+ public function checkShareFields($body){
+ if ($body instanceof \Behat\Gherkin\Node\TableNode) {
+ $fd = $body->getRowsHash();
+ foreach($fd as $field => $value) {
+ PHPUnit_Framework_Assert::assertEquals(True, $this->isFieldInResponse($field, $value));
+ }
+ }
+ }
+
public static function removeFile($path, $filename){
if (file_exists("$path" . "$filename")) {
unlink("$path" . "$filename");