◆ setUp()
ilServicesGlobalScreenTest::setUp |
( |
| ) |
|
|
protected |
◆ tearDown()
ilServicesGlobalScreenTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAdminAccessFalse()
ilServicesGlobalScreenTest::testAdminAccessFalse |
( |
| ) |
|
Definition at line 77 of file ilServicesGlobalScreenTest.php.
References $DIC, and SYSTEM_FOLDER_ID.
80 $DIC[
'rbacsystem'] = $rbac_mock = $this->createMock(ilRbacSystem::class);
83 $rbac_mock->expects($this->once())
84 ->method(
'checkAccess')
88 $this->assertFalse($class->hasAdministrationAccess()());
90 $class->hasAdministrationAccess()()
Class BasicAccessCheckClosures.
◆ testAdminAccessTrue()
ilServicesGlobalScreenTest::testAdminAccessTrue |
( |
| ) |
|
Definition at line 60 of file ilServicesGlobalScreenTest.php.
References $DIC, and SYSTEM_FOLDER_ID.
63 $DIC[
'rbacsystem'] = $rbac_mock = $this->createMock(ilRbacSystem::class);
66 $rbac_mock->expects($this->once())
67 ->method(
'checkAccess')
71 $this->assertTrue($class->hasAdministrationAccess()());
73 $class->hasAdministrationAccess()()
Class BasicAccessCheckClosures.
◆ testAdminAcessTrueButWithClosure()
ilServicesGlobalScreenTest::testAdminAcessTrueButWithClosure |
( |
| ) |
|
Definition at line 94 of file ilServicesGlobalScreenTest.php.
References $DIC, and SYSTEM_FOLDER_ID.
97 $DIC[
'rbacsystem'] = $rbac_mock = $this->createMock(ilRbacSystem::class);
100 $rbac_mock->expects($this->once())
101 ->method(
'checkAccess')
105 $closure_returning_false =
function ():
bool {
109 $this->assertTrue($class->hasAdministrationAccess()());
111 $class->hasAdministrationAccess($closure_returning_false)()
Class BasicAccessCheckClosures.
◆ testRepoAccessFalseLoggedIn()
ilServicesGlobalScreenTest::testRepoAccessFalseLoggedIn |
( |
| ) |
|
Definition at line 235 of file ilServicesGlobalScreenTest.php.
References $DIC, and ROOT_FOLDER_ID.
239 $DIC[
'ilUser'] =
$user_mock = $this->createMock(ilObjUser::class);
240 $DIC[
'ilSetting'] = $settings_mock = $this->createMock(ilSetting::class);
241 $DIC[
'ilAccess'] = $access_mock = $this->createMock(ilAccessHandler::class);
246 ->method(
'isAnonymous')
253 $settings_mock->expects($this->never())
256 $access_mock->expects($this->once())
257 ->method(
'checkAccess')
261 $this->assertFalse($class->isRepositoryReadable()());
263 $class->isRepositoryReadable()()
266 $class->isRepositoryReadable(
function ():
bool {
271 $class->isRepositoryReadable(
function ():
bool {
Class BasicAccessCheckClosures.
◆ testRepoAccessTrueLoggedIn()
ilServicesGlobalScreenTest::testRepoAccessTrueLoggedIn |
( |
| ) |
|
Definition at line 193 of file ilServicesGlobalScreenTest.php.
References $DIC, and ROOT_FOLDER_ID.
197 $DIC[
'ilUser'] =
$user_mock = $this->createMock(ilObjUser::class);
198 $DIC[
'ilSetting'] = $settings_mock = $this->createMock(ilSetting::class);
199 $DIC[
'ilAccess'] = $access_mock = $this->createMock(ilAccessHandler::class);
204 ->method(
'isAnonymous')
211 $settings_mock->expects($this->never())
214 $access_mock->expects($this->once())
215 ->method(
'checkAccess')
219 $this->assertTrue($class->isRepositoryReadable()());
221 $class->isRepositoryReadable()()
224 $class->isRepositoryReadable(
function ():
bool {
229 $class->isRepositoryReadable(
function ():
bool {
Class BasicAccessCheckClosures.
◆ testRepoAccessTrueNotLoggedInNoPublicSection()
ilServicesGlobalScreenTest::testRepoAccessTrueNotLoggedInNoPublicSection |
( |
| ) |
|
Definition at line 155 of file ilServicesGlobalScreenTest.php.
References $DIC.
159 $DIC[
'ilUser'] =
$user_mock = $this->createMock(ilObjUser::class);
160 $DIC[
'ilSetting'] = $settings_mock = $this->createMock(ilSetting::class);
161 $DIC[
'ilAccess'] = $access_mock = $this->createMock(ilAccessHandler::class);
166 ->method(
'isAnonymous')
169 $settings_mock->expects($this->once())
171 ->with(
'pub_section')
174 $access_mock->expects($this->never())
175 ->method(
'checkAccessOfUser');
177 $this->assertFalse($class->isRepositoryReadable()());
179 $class->isRepositoryReadable()()
182 $class->isRepositoryReadable(
function ():
bool {
187 $class->isRepositoryReadable(
function ():
bool {
Class BasicAccessCheckClosures.
◆ testRepoAccessTrueNotLoggedInPublicSection()
ilServicesGlobalScreenTest::testRepoAccessTrueNotLoggedInPublicSection |
( |
| ) |
|
Definition at line 115 of file ilServicesGlobalScreenTest.php.
References $DIC, and ROOT_FOLDER_ID.
119 $DIC[
'ilUser'] =
$user_mock = $this->createMock(ilObjUser::class);
120 $DIC[
'ilSetting'] = $settings_mock = $this->createMock(ilSetting::class);
121 $DIC[
'ilAccess'] = $access_mock = $this->createMock(ilAccessHandler::class);
126 ->method(
'isAnonymous')
129 $settings_mock->expects($this->once())
131 ->with(
'pub_section')
134 $access_mock->expects($this->once())
135 ->method(
'checkAccessOfUser')
136 ->with($this->isType(
'integer'),
'read',
'', $this->
ROOT_FOLDER_ID)
139 $this->assertTrue($class->isRepositoryReadable()());
141 $class->isRepositoryReadable()()
144 $class->isRepositoryReadable(
function ():
bool {
149 $class->isRepositoryReadable(
function ():
bool {
Class BasicAccessCheckClosures.
◆ $dic_backup
Container ilServicesGlobalScreenTest::$dic_backup = null |
|
private |
◆ $rbacsystem_mock
◆ $ROOT_FOLDER_ID
int ilServicesGlobalScreenTest::$ROOT_FOLDER_ID |
|
private |
◆ $SYSTEM_FOLDER_ID
int ilServicesGlobalScreenTest::$SYSTEM_FOLDER_ID |
|
private |
◆ $user_mock
ilObjUser ilServicesGlobalScreenTest::$user_mock |
|
private |
The documentation for this class was generated from the following file: