176 : void
177 {
180
181 $lastResetDate = $this->getMockBuilder(ilDate::class)
182 ->disableOriginalConstructor()
183 ->getMock();
184
185 $date = new DateTime();
186
187 $lastResetDate->setDate($date->getTimestamp(),
IL_CAL_UNIX);
188
189 $lastResetDate
190 ->expects($this->any())
191 ->method('get')
192 ->willReturn([
193 'seconds' => (int) $date->format('s'),
194 'minutes' => (int) $date->format('i'),
195 'hours' => (int) $date->format('G'),
196 'mday' => (int) $date->format('j'),
197 'wday' => (int) $date->format('w'),
198 'mon' => (int) $date->format('n'),
199 'year' => (int) $date->format('Y'),
200 'yday' => (int) $date->format('z'),
201 'weekday' => $date->format('l'),
202 'month' => $date->format('F'),
203 'isoday' => (int) $date->format('N')
204 ]);
205
206 $lastResetDate
207 ->expects($this->any())
208 ->method('isNull')
209 ->willReturn(true);
210
211 $this->tos
212 ->expects($this->any())
213 ->method('getLastResetDate')
214 ->willReturn($lastResetDate);
215
216 $this->ctrl
217 ->expects($this->once())
218 ->method('getCmd')
219 ->willReturn('getResetMessageBoxHtml');
220
221 $this->ctrl
222 ->expects($this->once())
223 ->method('getLinkTarget')
224 ->with($this->isInstanceOf(ilTermsOfServiceDocumentGUI::class), 'confirmReset')
225 ->willReturn('confirmReset');
226
227 $this->rbacsystem
228 ->expects($this->any())
229 ->method('checkAccess')
230 ->willReturn(true);
231
232 $buttonFactory = $this->getMockBuilder(\
ILIAS\
UI\Component\
Button\Factory::class)->getMock();
233 $button = $this->getMockBuilder(Standard::class)->getMock();
234
235 $buttonFactory
236 ->expects($this->once())
237 ->method('standard')
238 ->with($this->isType('string'), $this->equalTo('confirmReset'))
239 ->willReturn($button);
240
241 $this->uiFactory
242 ->expects($this->once())
243 ->method('button')
244 ->willReturn($buttonFactory);
245
246 $messageBoxFactory = $this->getMockBuilder(\
ILIAS\
UI\Component\
MessageBox\Factory::class)->getMock();
247 $info = $this->getMockBuilder(MessageBox::class)->getMock();
248
249 $messageBoxFactory
250 ->expects($this->once())
251 ->method('info')
252 ->with($this->stringContains('Some date:'))
253 ->willReturn($info);
254
255 $info
256 ->expects($this->once())
257 ->method('withButtons')
258 ->with($this->countOf(1));
259
260 $this->uiFactory
261 ->expects($this->once())
262 ->method('messageBox')
263 ->willReturn($messageBoxFactory);
264
266 ->expects($this->never())
267 ->method('raiseError');
268
269 $this->uiRenderer
270 ->expects($this->atLeast(1))
271 ->method('render')
272 ->willReturn('');
273
274 $this->lng
275 ->expects($this->exactly(2))
276 ->method('txt')
277 ->willReturnOnConsecutiveCalls(
278 'Some date: %s',
279 'Some button text'
280 );
281
283 $this->tos,
284 $this->criterionTypeFactory,
285 $this->tpl,
287 $this->ctrl,
288 $this->lng,
289 $this->rbacsystem,
291 $this->log,
292 $this->toolbar,
293 $this->httpState,
294 $this->uiFactory,
295 $this->uiRenderer,
296 $this->fileSystems,
297 $this->fileUpload,
298 $this->tableDataProviderFactory,
299 $this->documentPurifier
300 );
301
302 $gui->executeCommand();
303 }
setGlobalVariable(string $name, $value)
Class ChatMainBarProvider \MainMenu\Provider.