ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LegalDocuments\test\Condition\RoleTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\Condition\RoleTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\Condition\RoleTest:

Public Member Functions

 testConstruct ()
 
 testAsComponent ()
 
 testEval ()
 
 testDefinition ()
 
 testKnownToNeverMatchWith ()
 

Detailed Description

Definition at line 36 of file RoleTest.php.

Member Function Documentation

◆ testAsComponent()

ILIAS\LegalDocuments\test\Condition\RoleTest::testAsComponent ( )

Definition at line 50 of file RoleTest.php.

50 : void
51 {
52 $legacy = $this->mock(Legacy\Content::class);
53 $legacy_factory = $this->mock(Legacy\Factory::class);
54 $legacy_factory
55 ->expects($this->once())
56 ->method('content')
57 ->willReturn($legacy);
58
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)
64 ))->asComponent());
65 }

References ILIAS\LegalDocuments\Condition\asComponent().

+ Here is the call graph for this function:

◆ testConstruct()

ILIAS\LegalDocuments\test\Condition\RoleTest::testConstruct ( )

Definition at line 40 of file RoleTest.php.

40 : void
41 {
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)
47 ));
48 }

◆ testDefinition()

ILIAS\LegalDocuments\test\Condition\RoleTest::testDefinition ( )

Definition at line 81 of file RoleTest.php.

81 : void
82 {
83 $definition = $this->mock(RoleDefinition::class);
84
85 $instance = new Role(
86 $this->mock(CriterionContent::class),
87 $definition,
88 $this->mock(UIFactory::class),
89 $this->mock(ilRbacReview::class)
90 );
91
92 $this->assertSame($definition, $instance->definition());
93 }

◆ testEval()

ILIAS\LegalDocuments\test\Condition\RoleTest::testEval ( )

Definition at line 67 of file RoleTest.php.

67 : void
68 {
69 $rbac = $this->mockMethod(ilRbacReview::class, 'isAssigned', [45, 78], true);
70
71 $instance = new Role(
72 $this->mockTree(CriterionContent::class, ['arguments' => ['role_id' => 78]]),
73 $this->mock(RoleDefinition::class),
74 $this->mock(UIFactory::class),
75 $rbac
76 );
77
78 $this->assertTrue($instance->eval($this->mockTree(ilObjUser::class, ['getId' => 45])));
79 }

◆ testKnownToNeverMatchWith()

ILIAS\LegalDocuments\test\Condition\RoleTest::testKnownToNeverMatchWith ( )

Definition at line 95 of file RoleTest.php.

95 : void
96 {
97 $instance = new Role(
98 $this->mock(CriterionContent::class),
99 $this->mock(RoleDefinition::class),
100 $this->mock(UIFactory::class),
101 $this->mock(ilRbacReview::class)
102 );
103
104 $this->assertFalse($instance->knownToNeverMatchWith($this->mock(Condition::class)));
105 }

The documentation for this class was generated from the following file: