19 declare(strict_types=1);
34 require_once __DIR__ .
'/../ContainerMock.php';
42 $this->assertInstanceOf(Role::class,
new Role(
43 $this->mock(CriterionContent::class),
44 $this->mock(RoleDefinition::class),
45 $this->mock(UIFactory::class),
46 $this->mock(ilRbacReview::class)
52 $legacy = $this->mock(Legacy\Content::class);
53 $legacy_factory = $this->mock(Legacy\Factory::class);
55 ->expects($this->once())
57 ->willReturn($legacy);
59 $this->assertSame($legacy, (
new Role(
60 $this->mockTree(CriterionContent::class, [
'arguments' => [
'role_id' => 78]]),
61 $this->mock(RoleDefinition::class),
62 $this->mockTree(UIFactory::class, [
'legacy' => $legacy_factory]),
63 $this->mock(ilRbacReview::class)
69 $rbac = $this->mockMethod(ilRbacReview::class,
'isAssigned', [45, 78],
true);
72 $this->mockTree(CriterionContent::class, [
'arguments' => [
'role_id' => 78]]),
73 $this->mock(RoleDefinition::class),
74 $this->mock(UIFactory::class),
78 $this->assertTrue($instance->eval($this->mockTree(ilObjUser::class, [
'getId' => 45])));
83 $definition = $this->mock(RoleDefinition::class);
86 $this->mock(CriterionContent::class),
88 $this->mock(UIFactory::class),
89 $this->mock(ilRbacReview::class)
92 $this->assertSame($definition, $instance->definition());
98 $this->mock(CriterionContent::class),
99 $this->mock(RoleDefinition::class),
100 $this->mock(UIFactory::class),
101 $this->mock(ilRbacReview::class)
104 $this->assertFalse($instance->knownToNeverMatchWith($this->mock(Condition::class)));
testKnownToNeverMatchWith()