16 ->getMockBuilder(\ilCtrl::class)
17 ->disableOriginalConstructor()
18 ->setMethods([
'redirectToURL',
'getCmdClass',
'getCmd'])
22 ->expects($this->any())
23 ->method(
'getCmdClass')
24 ->willReturn(
'ilPersonalDesktopGUI');
27 ->expects($this->any())
32 ->expects($this->
once())
33 ->method(
'redirectToURL');
36 ->getMockBuilder(\ilObjUser::class)
37 ->disableOriginalConstructor()
38 ->setMethods([
'hasToAcceptTermsOfService',
'checkTimeLimit',
'hasToAcceptTermsOfServiceInSession'])
42 ->expects($this->atLeast(1))
43 ->method(
'hasToAcceptTermsOfService')
47 ->expects($this->atLeast(1))
48 ->method(
'checkTimeLimit')
52 ->expects($this->atLeast(1))
53 ->method(
'hasToAcceptTermsOfServiceInSession')
56 $requestInterceptor = new \ilTermsOfServiceRequestTargetAdjustmentCase(
$user, $ctrl);
58 $this->assertTrue($requestInterceptor->shouldAdjustRequest());
59 $this->assertTrue($requestInterceptor->shouldStoreRequestTarget());
60 $requestInterceptor->adjust();
69 ->getMockBuilder(\ilCtrl::class)
70 ->disableOriginalConstructor()
71 ->setMethods([
'getCmdClass',
'getCmd'])
75 ->expects($this->atLeast(1))
76 ->method(
'getCmdClass')
77 ->willReturn(
'ilstartupgui');
80 ->expects($this->atLeast(1))
82 ->willReturn(
'getacceptance');
85 ->getMockBuilder(\ilObjUser::class)
86 ->disableOriginalConstructor()
87 ->setMethods([
'hasToAcceptTermsOfService',
'checkTimeLimit',
'hasToAcceptTermsOfServiceInSession'])
91 ->expects($this->any())
92 ->method(
'hasToAcceptTermsOfService')
96 ->expects($this->any())
97 ->method(
'checkTimeLimit')
101 ->expects($this->any())
102 ->method(
'hasToAcceptTermsOfServiceInSession')
105 $requestInterceptor = new \ilTermsOfServiceRequestTargetAdjustmentCase(
$user, $ctrl);
107 $this->assertFalse($requestInterceptor->shouldAdjustRequest());
116 ->getMockBuilder(\ilObjUser::class)
117 ->disableOriginalConstructor()
118 ->setMethods([
'hasToAcceptTermsOfService',
'checkTimeLimit',
'hasToAcceptTermsOfServiceInSession'])
122 ->expects($this->any())
123 ->method(
'hasToAcceptTermsOfService')
127 ->expects($this->any())
128 ->method(
'checkTimeLimit')
132 ->expects($this->any())
133 ->method(
'hasToAcceptTermsOfServiceInSession')
137 ->getMockBuilder(\ilObjUser::class)
138 ->disableOriginalConstructor()
139 ->setMethods([
'hasToAcceptTermsOfService',
'checkTimeLimit',
'hasToAcceptTermsOfServiceInSession'])
143 ->expects($this->any())
144 ->method(
'hasToAcceptTermsOfService')
148 ->expects($this->any())
149 ->method(
'checkTimeLimit')
153 ->expects($this->any())
154 ->method(
'hasToAcceptTermsOfServiceInSession')
158 ->getMockBuilder(\ilObjUser::class)
159 ->disableOriginalConstructor()
160 ->setMethods([
'hasToAcceptTermsOfService',
'checkTimeLimit',
'hasToAcceptTermsOfServiceInSession'])
164 ->expects($this->any())
165 ->method(
'hasToAcceptTermsOfService')
169 ->expects($this->any())
170 ->method(
'checkTimeLimit')
174 ->expects($this->any())
175 ->method(
'hasToAcceptTermsOfServiceInSession')
192 ->getMockBuilder(\ilCtrl::class)
193 ->disableOriginalConstructor()
194 ->setMethods([
'getCmdClass',
'getCmd'])
198 ->expects($this->any())
199 ->method(
'getCmdClass')
200 ->willReturn(
'ilPersonalDesktopGUI');
203 ->expects($this->any())
207 $requestInterceptor = new \ilTermsOfServiceRequestTargetAdjustmentCase($user, $ctrl);
209 $this->assertFalse($requestInterceptor->shouldAdjustRequest());
Class ilTermsOfServiceBaseTest.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
testUserShouldNotBeForcedToAcceptTermsOfServiceWhenAlreadyDone(\ilObjUser $user)
userProvider
Class ilTermsOfServiceRequestTargetAdjustmentCaseTest.
testUserShouldBeForcedToAcceptTermsOfServiceWhenNotDoingItYetInCurrentRequest()
testUserShouldNotBeForcedToAcceptTermsOfServiceWhenDoingItAlreadyInCurrentRequest()