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 @@ -54,7 +54,9 @@ public function asCreatingAShareWith($user, $body) {
5454 $ fd = $ body ->getRowsHash ();
5555 if (array_key_exists ('expireDate ' , $ fd )) {
5656 $ dateModification = $ fd ['expireDate ' ];
57- $ fd ['expireDate ' ] = date ('Y-m-d ' , strtotime ($ dateModification ));
57+ if (!empty ($ dateModification )) {
58+ $ fd ['expireDate ' ] = date ('Y-m-d ' , strtotime ($ dateModification ));
59+ }
5860 }
5961 $ options ['form_params ' ] = $ fd ;
6062 }
@@ -301,7 +303,9 @@ public function createShare($user,
301303 public function isFieldInResponse ($ field , $ contentExpected ) {
302304 $ data = simplexml_load_string ($ this ->response ->getBody ())->data [0 ];
303305 if ((string )$ field == 'expiration ' ) {
304- $ 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+ }
305309 }
306310 if (count ($ data ->element ) > 0 ) {
307311 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