ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceCriterionBaseTest Class Reference

Class ilTermsOfServiceCriterionBaseTest. More...

+ Inheritance diagram for ilTermsOfServiceCriterionBaseTest:
+ Collaboration diagram for ilTermsOfServiceCriterionBaseTest:

Protected Member Functions

 getRbacReviewMock ()
 
 getObjectDataCacheMock ()
 
 getRadioGroupMock ()
 
 getFormMock ()
 
 getUserMock ()
 
- Protected Member Functions inherited from ilTermsOfServiceBaseTest
 setUp ()
 
 getLanguageMock ()
 
 getUiFactoryMock ()
 
 setGlobalVariable (string $name, $value)
 
 getCriterionConfig ($value=null)
 

Additional Inherited Members

- Protected Attributes inherited from ilTermsOfServiceBaseTest
 $dic
 

Detailed Description

Member Function Documentation

◆ getFormMock()

ilTermsOfServiceCriterionBaseTest::getFormMock ( )
protected
Returns
MockObject|ilPropertyFormGUI
Exceptions
ReflectionException

Definition at line 65 of file ilTermsOfServiceCriterionBaseTest.php.

Referenced by ilTermsOfServiceNullCriterionTest\buildForm(), ilTermsOfServiceUserHasLanguageCriterionTest\buildForm(), and ilTermsOfServiceUserHasGlobalRoleCriterionTest\buildForm().

66  {
67  $form = $this
68  ->getMockBuilder(ilPropertyFormGUI::class)
69  ->disableOriginalConstructor()
70  ->setMethods(['getInput'])
71  ->getMock();
72 
73  return $form;
74  }
This class represents a property form user interface.
+ Here is the caller graph for this function:

◆ getObjectDataCacheMock()

ilTermsOfServiceCriterionBaseTest::getObjectDataCacheMock ( )
protected
Returns
MockObject|ilObjectDataCache
Exceptions
ReflectionException

Definition at line 36 of file ilTermsOfServiceCriterionBaseTest.php.

Referenced by ilTermsOfServiceUserHasGlobalRoleCriterionTest\getInstance(), and ilTermsOfServiceUserHasGlobalRoleCriterionTest\objectCacheProvider().

37  {
38  $objectDataCache = $this
39  ->getMockBuilder(ilObjectDataCache::class)
40  ->disableOriginalConstructor()
41  ->getMock();
42 
43  return $objectDataCache;
44  }
class ilObjectDataCache
+ Here is the caller graph for this function:

◆ getRadioGroupMock()

ilTermsOfServiceCriterionBaseTest::getRadioGroupMock ( )
protected
Returns
MockObject|ilRadioGroupInputGUI
Exceptions
ReflectionException

Definition at line 50 of file ilTermsOfServiceCriterionBaseTest.php.

Referenced by ilTermsOfServiceUserHasLanguageCriterionTest\buildForm(), and ilTermsOfServiceUserHasGlobalRoleCriterionTest\buildForm().

51  {
52  $radioGroup = $this
53  ->getMockBuilder(ilRadioGroupInputGUI::class)
54  ->disableOriginalConstructor()
55  ->setMethods(['getPostVar'])
56  ->getMock();
57 
58  return $radioGroup;
59  }
This class represents a property in a property form.
+ Here is the caller graph for this function:

◆ getRbacReviewMock()

ilTermsOfServiceCriterionBaseTest::getRbacReviewMock ( )
protected
Returns
MockObject|ilRbacReview
Exceptions
ReflectionException

Definition at line 16 of file ilTermsOfServiceCriterionBaseTest.php.

Referenced by ilTermsOfServiceUserHasGlobalRoleCriterionTest\getInstance(), and ilTermsOfServiceUserHasGlobalRoleCriterionTest\objectCacheProvider().

16  : ilRbacReview
17  {
18  $rbacReview = $this
19  ->getMockBuilder(ilRbacReview::class)
20  ->disableOriginalConstructor()
21  ->setMethods(['isGlobalRole', 'isAssigned', 'getGlobalRoles'])
22  ->getMock();
23 
24  $rbacReview
25  ->expects($this->any())
26  ->method('getGlobalRoles')
27  ->willReturn([2, 4]);
28 
29  return $rbacReview;
30  }
class ilRbacReview Contains Review functions of core Rbac.
+ Here is the caller graph for this function:

◆ getUserMock()

ilTermsOfServiceCriterionBaseTest::getUserMock ( )
protected
Returns
MockObject|ilObjUser
Exceptions
ReflectionException

Definition at line 80 of file ilTermsOfServiceCriterionBaseTest.php.

Referenced by ilTermsOfServiceNullCriterionTest\testEvaluationAlwaysSucceeds(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\testEvaluationFailsIfConfiguredRoleDoesNotMatchTheExpectedFormat(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\testEvaluationFailsIfConfiguredRoleIsNotAGlobalRole(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\testEvaluationFailsIfUserIsNotAssignedToConfiguredGlobalRole(), ilTermsOfServiceUserHasLanguageCriterionTest\testEvaluationFailsIfUserLanguageDoesNotMatchDefinedLanguage(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\testEvaluationSucceedsIfUserIsAssignedToDefinedGlobalRole(), and ilTermsOfServiceUserHasLanguageCriterionTest\testEvaluationSucceedsIfUserLanguageDoesMatchDefinedLanguage().

80  : ilObjUser
81  {
82  $user = $this
83  ->getMockBuilder(ilObjUser::class)
84  ->disableOriginalConstructor()
85  ->setMethods(['getLanguage', 'getId', 'getLogin'])
86  ->getMock();
87 
88  $user
89  ->expects($this->any())
90  ->method('getId')
91  ->willReturn(-1);
92 
93  $user
94  ->expects($this->any())
95  ->method('getLogin')
96  ->willReturn('phpunit');
97 
98  return $user;
99  }
+ Here is the caller graph for this function:

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