185 ->expects($this->any())
189 $lastResetDate = $this->getMockBuilder(\ilDate::class)
190 ->disableOriginalConstructor()
193 $date = new \DateTime();
195 $lastResetDate->setDate($date->getTimestamp(),
IL_CAL_UNIX);
198 ->expects($this->any())
201 'seconds' => (
int) $date->format(
's'),
202 'minutes' => (int) $date->format(
'i'),
203 'hours' => (int) $date->format(
'G'),
204 'mday' => (int) $date->format(
'j'),
205 'wday' => (int) $date->format(
'w'),
206 'mon' => (int) $date->format(
'n'),
207 'year' => (int) $date->format(
'Y'),
208 'yday' => (int) $date->format(
'z'),
209 'weekday' => $date->format(
'l'),
210 'month' => $date->format(
'F'),
211 'isoday' => (int) $date->format(
'N')
215 ->expects($this->any())
220 ->expects($this->any())
221 ->method(
'getLastResetDate')
222 ->willReturn($lastResetDate);
225 ->expects($this->
once())
227 ->willReturn(
'getResetMessageBoxHtml');
230 ->expects($this->
once())
231 ->method(
'getLinkTarget')
232 ->with($this->isInstanceOf(\ilTermsOfServiceDocumentGUI::class),
'confirmReset')
233 ->willReturn(
'confirmReset');
236 ->expects($this->any())
237 ->method(
'checkAccess')
244 ->expects($this->
once())
246 ->with($this->isType(
'string'), $this->equalTo(
'confirmReset'))
247 ->willReturn($button);
250 ->expects($this->
once())
252 ->willReturn($buttonFactory);
254 $messageBoxFactory = $this->getMockBuilder(\
ILIAS\
UI\
Component\MessageBox\Factory::class)->getMock();
258 ->expects($this->
once())
260 ->with($this->stringContains(
'Some date:'))
264 ->expects($this->
once())
265 ->method(
'withButtons')
266 ->with($this->countOf(1));
269 ->expects($this->
once())
270 ->method(
'messageBox')
271 ->willReturn($messageBoxFactory);
274 ->expects($this->never())
275 ->method(
'raiseError');
278 ->expects($this->atLeast(1))
283 ->expects($this->exactly(2))
285 ->willReturnOnConsecutiveCalls(
290 $gui = new \ilTermsOfServiceDocumentGUI(
292 $this->criterionTypeFactory,
306 $this->tableDataProviderFactory,
307 $this->documentPurifier
310 $gui->executeCommand();
setGlobalVariable(string $name, $value)
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.