@@ -64,13 +64,13 @@ protected function setUp(): void {
64
64
65
65
public function dataExecute () {
66
66
return [
67
- ['user ' , '' , '' , false , null , false , null , 123 , null , 1 ],
68
- ['user ' , '' , '' , false , null , false , 'user ' , 123 , null , 1 ],
69
- ['user ' , str_repeat ('a ' , 256 ), '' , false , null , false , 'user ' , 123 , null , 1 ],
70
- ['user ' , 'short ' , '' , true , false , false , 'user ' , 123 , ' 7b ' , 0 ],
71
- ['user ' , 'short ' , str_repeat ('a ' , 4001 ), false , null , false , 'user ' , 123 , null , 1 ],
72
- ['user ' , 'short ' , str_repeat ('a ' , 4000 ), true , false , true , 'user ' , 123 , ' 7b ' , 0 ],
73
- ['user ' , 'short ' , 'long ' , true , true , true , 'user ' , 123 , ' 7b ' , 1 ],
67
+ ['user ' , '' , '' , false , null , false , null , false , 1 ],
68
+ ['user ' , '' , '' , false , null , false , 'user ' , false , 1 ],
69
+ ['user ' , str_repeat ('a ' , 256 ), '' , false , null , false , 'user ' , false , 1 ],
70
+ ['user ' , 'short ' , '' , true , false , false , 'user ' , true , 0 ],
71
+ ['user ' , 'short ' , str_repeat ('a ' , 4001 ), false , null , false , 'user ' , false , 1 ],
72
+ ['user ' , 'short ' , str_repeat ('a ' , 4000 ), true , false , true , 'user ' , true , 0 ],
73
+ ['user ' , 'short ' , 'long ' , true , true , true , 'user ' , true , 1 ],
74
74
];
75
75
}
76
76
@@ -83,11 +83,10 @@ public function dataExecute() {
83
83
* @param bool $notifyThrows
84
84
* @param bool $validLong
85
85
* @param string|null $user
86
- * @param int $time
87
- * @param string|null $hexTime
86
+ * @param bool $isCreated
88
87
* @param int $exitCode
89
88
*/
90
- public function testExecute ($ userId , $ short , $ long , $ createNotification , $ notifyThrows , $ validLong , $ user , $ time , $ hexTime , $ exitCode ) {
89
+ public function testExecute ($ userId , $ short , $ long , $ createNotification , $ notifyThrows , $ validLong , $ user , $ isCreated , $ exitCode ) {
91
90
if ($ user !== null ) {
92
91
$ u = $ this ->createMock (IUser::class);
93
92
$ u ->expects ($ createNotification ? $ this ->once () : $ this ->never ())
@@ -101,9 +100,10 @@ public function testExecute($userId, $short, $long, $createNotification, $notify
101
100
->with ($ userId )
102
101
->willReturn ($ u );
103
102
104
- $ this ->timeFactory ->expects ($ hexTime === null ? $ this ->never () : $ this ->once ())
105
- ->method ('getTime ' )
106
- ->willReturn ($ time );
103
+ $ dateTime = new \DateTime ();
104
+ $ this ->timeFactory ->expects (!$ isCreated ? $ this ->never () : $ this ->once ())
105
+ ->method ('getDateTime ' )
106
+ ->willReturn ($ dateTime );
107
107
108
108
if ($ createNotification ) {
109
109
$ n = $ this ->createMock (INotification::class);
@@ -117,10 +117,11 @@ public function testExecute($userId, $short, $long, $createNotification, $notify
117
117
->willReturnSelf ();
118
118
$ n ->expects ($ this ->once ())
119
119
->method ('setDateTime ' )
120
+ ->with ($ dateTime )
120
121
->willReturnSelf ();
121
122
$ n ->expects ($ this ->once ())
122
123
->method ('setObject ' )
123
- ->with ('admin_notifications ' , $ hexTime )
124
+ ->with ('admin_notifications ' , dechex ( $ dateTime -> getTimestamp ()) )
124
125
->willReturnSelf ();
125
126
$ n ->expects ($ this ->once ())
126
127
->method ('setSubject ' )
0 commit comments