summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/Sharing.php
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2024-05-22 14:17:24 +0100
committerAndy Scherzinger <info@andy-scherzinger.de>2024-06-13 18:34:51 +0200
commit530b45e96d5cc92e42faba859380b4e12f97956a (patch)
tree68b39dd790b63ef7954b4bf2e922deda0e9b69b0 /build/integration/features/bootstrap/Sharing.php
parentda7ac549f0b3cb636f0342ac0e4fd100a177a0ce (diff)
downloadnextcloud-server-530b45e96d5cc92e42faba859380b4e12f97956a.tar.gz
nextcloud-server-530b45e96d5cc92e42faba859380b4e12f97956a.zip
test(Sharing): Integration test for no expiration set date for share
- Verify that explicitly sending empty `expireDate` param to server overwrite default and sets not expiry date, if non is enforced. - Update tests to avoid converting empty string to date. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'build/integration/features/bootstrap/Sharing.php')
-rw-r--r--build/integration/features/bootstrap/Sharing.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php
index a38ef392e61..0f1b2215639 100644
--- a/build/integration/features/bootstrap/Sharing.php
+++ b/build/integration/features/bootstrap/Sharing.php
@@ -81,7 +81,9 @@ trait Sharing {
$fd = $body->getRowsHash();
if (array_key_exists('expireDate', $fd)) {
$dateModification = $fd['expireDate'];
- $fd['expireDate'] = date('Y-m-d', strtotime($dateModification));
+ if (!empty($dateModification)) {
+ $fd['expireDate'] = date('Y-m-d', strtotime($dateModification));
+ }
}
$options['form_params'] = $fd;
}
@@ -328,7 +330,9 @@ trait Sharing {
public function isFieldInResponse($field, $contentExpected) {
$data = simplexml_load_string($this->response->getBody())->data[0];
if ((string)$field == 'expiration') {
- $contentExpected = date('Y-m-d', strtotime($contentExpected)) . " 00:00:00";
+ if (!empty($contentExpected)) {
+ $contentExpected = date('Y-m-d', strtotime($contentExpected)) . " 00:00:00";
+ }
}
if (count($data->element) > 0) {
foreach ($data as $element) {