File tree 4 files changed +17
-16
lines changed
phpunit/functional/Glpi/Form
4 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 40
40
use Glpi \Form \Answer ;
41
41
use Glpi \Form \AnswersHandler \AnswersHandler ;
42
42
use Glpi \Form \AnswersSet ;
43
+ use Glpi \Form \DelegationData ;
43
44
use Glpi \Form \Destination \FormDestinationProblem ;
44
45
use Glpi \Form \Form ;
45
46
use Glpi \Form \Question ;
@@ -150,11 +151,11 @@ public function testGetDelegationWihoutRights()
150
151
[],
151
152
\Session::getLoginUserID (),
152
153
[],
153
- [
154
- ' users_id ' => getitemByTypeName (User::class, 'glpi ' )->getID (),
155
- ' use_notification ' => true ,
156
- 'alternative_email ' => ' '
157
- ]
154
+ new DelegationData (
155
+ getitemByTypeName (User::class, 'glpi ' )->getID (),
156
+ true ,
157
+ ''
158
+ )
158
159
);
159
160
160
161
/** @var Ticket $ticket */
@@ -217,11 +218,11 @@ public function testGetDelegation()
217
218
[],
218
219
\Session::getLoginUserID (),
219
220
[],
220
- [
221
- ' users_id ' => getitemByTypeName (User::class, 'glpi ' )->getID (),
222
- ' use_notification ' => true ,
223
- 'alternative_email ' => ' '
224
- ]
221
+ new DelegationData (
222
+ getitemByTypeName (User::class, 'glpi ' )->getID (),
223
+ true ,
224
+ ''
225
+ ),
225
226
);
226
227
227
228
/** @var Ticket $ticket */
Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ private function saveSubmittedAnswers(
113
113
$ form ,
114
114
$ answers ,
115
115
Session::getLoginUserID (),
116
- $ delegation ,
117
- $ files
116
+ $ files ,
117
+ $ delegation
118
118
);
119
119
120
120
return $ answers ;
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ public function saveAnswers(
93
93
Form $ form ,
94
94
array $ answers ,
95
95
int $ users_id ,
96
- DelegationData $ delegation ,
97
96
array $ files = [],
97
+ DelegationData $ delegation = new DelegationData (),
98
98
): AnswersSet {
99
99
/** @var \DBmysql $DB */
100
100
global $ DB ;
Original file line number Diff line number Diff line change 37
37
final class DelegationData
38
38
{
39
39
public function __construct (
40
- public readonly ?int $ users_id ,
41
- public readonly ?bool $ use_notification ,
42
- public readonly ?string $ alternative_email
40
+ public readonly ?int $ users_id = null ,
41
+ public readonly ?bool $ use_notification = null ,
42
+ public readonly ?string $ alternative_email = null
43
43
) {
44
44
}
45
45
}
You can’t perform that action at this time.
0 commit comments