Skip to content

Commit 30e59ba

Browse files
committed
wip : fixup
Signed-off-by: fenn-cs <[email protected]>
1 parent 18cd360 commit 30e59ba

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

build/integration/features/bootstrap/Sharing.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function asCreatingAShareWith($user, $body) {
5454
$fd = $body->getRowsHash();
5555
if (array_key_exists('expireDate', $fd)) {
5656
$dateModification = $fd['expireDate'];
57-
if ($dateModification !== 'EMPTY_STRING') {
57+
if (!empty($dateModification)) {
5858
$fd['expireDate'] = date('Y-m-d', strtotime($dateModification));
5959
}
6060
}
@@ -296,15 +296,16 @@ public function createShare($user,
296296
$this->lastShareData = simplexml_load_string($this->response->getBody());
297297
} catch (\GuzzleHttp\Exception\ClientException $ex) {
298298
$this->response = $ex->getResponse();
299-
print(json_encode($this->response));
300299
throw new \Exception($this->response->getBody());
301300
}
302301
}
303302

304303
public function isFieldInResponse($field, $contentExpected) {
305304
$data = simplexml_load_string($this->response->getBody())->data[0];
306305
if ((string)$field == 'expiration') {
307-
$contentExpected = date('Y-m-d', strtotime($contentExpected)) . " 00:00:00";
306+
if(!empty($contentExpected)) {
307+
$contentExpected = date('Y-m-d', strtotime($contentExpected)) . " 00:00:00";
308+
}
308309
}
309310
if (count($data->element) > 0) {
310311
foreach ($data as $element) {
@@ -314,8 +315,8 @@ public function isFieldInResponse($field, $contentExpected) {
314315
return is_numeric((string)$element->$field);
315316
} elseif ($contentExpected == "AN_URL") {
316317
return $this->isExpectedUrl((string)$element->$field, "index.php/s/");
317-
} elseif ($contentExpected == "EMPTY_STRING") {
318-
return ((string)$element->$field === '');
318+
} elseif ($contentExpected == "EMPTY") {
319+
return empty((string)$element->$field);
319320
} elseif ((string)$element->$field == $contentExpected) {
320321
return true;
321322
} else {
@@ -331,6 +332,8 @@ public function isFieldInResponse($field, $contentExpected) {
331332
return is_numeric((string)$data->$field);
332333
} elseif ($contentExpected == "AN_URL") {
333334
return $this->isExpectedUrl((string)$data->$field, "index.php/s/");
335+
} elseif ($contentExpected == "EMPTY") {
336+
return empty((string)$data->$field);
334337
} elseif ($contentExpected == $data->$field) {
335338
return true;
336339
}

build/integration/sharing_features/sharing-v1.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ Feature: sharing
238238
| path | welcome.txt |
239239
| shareWith | user1 |
240240
| shareType | 0 |
241-
| expireDate | EMPTY_STRING |
241+
| expireDate | |
242242
Then the OCS status code should be "100"
243243
And the HTTP status code should be "200"
244244
And Getting info of last share
245245
Then the OCS status code should be "100"
246246
And the HTTP status code should be "200"
247247
And Share fields of last share match with
248-
| expiration | EMPTY_STRING |
248+
| expiration ||
249249

250250
Scenario: Creating a new public share, updating its password and getting its info
251251
Given user "user0" exists

0 commit comments

Comments
 (0)