File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ public function asCreatingAShareWith($user, $body) {
8181 $ fd = $ body ->getRowsHash ();
8282 if (array_key_exists ('expireDate ' , $ fd )) {
8383 $ dateModification = $ fd ['expireDate ' ];
84- $ fd ['expireDate ' ] = date ('Y-m-d ' , strtotime ($ dateModification ));
84+ if (!empty ($ dateModification )) {
85+ $ fd ['expireDate ' ] = date ('Y-m-d ' , strtotime ($ dateModification ));
86+ }
8587 }
8688 $ options ['form_params ' ] = $ fd ;
8789 }
@@ -328,7 +330,9 @@ public function createShare($user,
328330 public function isFieldInResponse ($ field , $ contentExpected ) {
329331 $ data = simplexml_load_string ($ this ->response ->getBody ())->data [0 ];
330332 if ((string )$ field == 'expiration ' ) {
331- $ contentExpected = date ('Y-m-d ' , strtotime ($ contentExpected )) . " 00:00:00 " ;
333+ if (!empty ($ contentExpected )) {
334+ $ contentExpected = date ('Y-m-d ' , strtotime ($ contentExpected )) . " 00:00:00 " ;
335+ }
332336 }
333337 if (count ($ data ->element ) > 0 ) {
334338 foreach ($ data as $ element ) {
Original file line number Diff line number Diff line change @@ -229,6 +229,24 @@ Feature: sharing
229229 | url | AN_URL |
230230 | mimetype | httpd /unix -directory |
231231
232+ Scenario : Creating a new share with expiration date removed, when default expiration is set
233+ Given user "user0" exists
234+ And user "user1" exists
235+ And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
236+ And As an "user0"
237+ When creating a share with
238+ | path | welcome .txt |
239+ | shareWith | user1 |
240+ | shareType | 0 |
241+ | expireDate | |
242+ Then the OCS status code should be "100"
243+ And the HTTP status code should be "200"
244+ And Getting info of last share
245+ Then the OCS status code should be "100"
246+ And the HTTP status code should be "200"
247+ And Share fields of last share match with
248+ | expiration ||
249+
232250 Scenario : Creating a new public share, updating its password and getting its info
233251 Given user "user0" exists
234252 And As an "user0"
You can’t perform that action at this time.
0 commit comments