19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
34 $this->createMock(\ilRbacReview::class),
35 $this->createMock(\ilRbacSystem::class),
36 $this->createMock(\ilRbacAdmin::class),
40 $this->assertSame($services,
$container->rbac());
46 $review = $this->createMock(\ilRbacReview::class);
47 $system = $this->createMock(\ilRbacSystem::class);
48 $admin = $this->createMock(\ilRbacAdmin::class);
53 $this->assertInstanceOf(RBACServicesLegacyProxy::class,
$container->rbac());
54 $this->assertSame($review,
$container->rbac()->review());
55 $this->assertSame($system,
$container->rbac()->system());
56 $this->assertSame($admin,
$container->rbac()->admin());
66 $system = $this->createMock(\ilRbacSystem::class);
69 $this->assertSame($system,
$container->rbac()->system());
78 $overridden = array_map(
79 static fn(\ReflectionMethod $method):
string => $method->getName(),
80 (
new \ReflectionClass(RBACServicesLegacyProxy::class))->getMethods(\ReflectionMethod::IS_PUBLIC)
83 foreach ((
new \ReflectionClass(RBACServices::class))->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
84 if ($method->isConstructor()) {
87 $this->assertContains($method->getName(), $overridden);
Customizing of pimple-DIC for ILIAS.
testEveryServiceGetterIsOverridden()
Every getter of RBACServices has to be overridden, since the proxy holds no services of its own.
testARegisteredServiceIsPreferred()
testTheLegacyOffsetsAnswerWithoutARegisteredService()
testOnlyTheRequestedOffsetIsResolved()
Tests commonly register only the offset they are about, so asking for one service must not resolve th...
Class ilRbacAdmin Core functions for role based access control.
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...