ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTermsOfServiceEvaluationBaseTest Class Reference

Class ilTermsOfServiceEvaluationBaseTest. More...

+ Inheritance diagram for ilTermsOfServiceEvaluationBaseTest:
+ Collaboration diagram for ilTermsOfServiceEvaluationBaseTest:

Protected Member Functions

 getUserMock ()
 
 getLogMock ()
 
 getEvaluatorMock ()
 
 getCriterionTypeFactoryMock ()
 
 getCriterionTypeMock (string $typeIdent)
 
 getCriterionAssignmentMock (ilTermsOfServiceCriterionType $criterionType)
 
- 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

◆ getCriterionAssignmentMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionAssignmentMock ( ilTermsOfServiceCriterionType  $criterionType)
protected
Parameters
ilTermsOfServiceCriterionType$criterionType
Returns
MockObject|ilTermsOfServiceEvaluableCriterion
Exceptions
ReflectionException

Definition at line 102 of file ilTermsOfServiceEvaluationBaseTest.php.

105 $criterionAssignment = $this
106 ->getMockBuilder(ilTermsOfServiceEvaluableCriterion::class)
107 ->getMock();
108
109 $criterionAssignment
110 ->expects($this->any())
111 ->method('getCriterionId')
112 ->willReturn($criterionType->getTypeIdent());
113
114 return $criterionAssignment;
115 }
getTypeIdent()
Returns a unique id of the criterion type.
Interface ilTermsOfServiceEvaluableCriterion.

Referenced by ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsFalseIfAnyCriteriaAttachedToADocumentDoesNotMatch(), and ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfAllCriteriaAttachedToADocumentMatch().

+ Here is the caller graph for this function:

◆ getCriterionTypeFactoryMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionTypeFactoryMock ( )
protected
Returns
MockObject|ilTermsOfServiceCriterionTypeFactoryInterface
Exceptions
ReflectionException

Definition at line 69 of file ilTermsOfServiceEvaluationBaseTest.php.

70 {
71 $criterionTypeFactory = $this
72 ->getMockBuilder(ilTermsOfServiceCriterionTypeFactoryInterface::class)
73 ->getMock();
74
75 return $criterionTypeFactory;
76 }

Referenced by ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsFalseIfAnyCriteriaAttachedToADocumentDoesNotMatch(), ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfAllCriteriaAttachedToADocumentMatch(), and ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfNoCriterionIsAttachedToADocumentAtAll().

+ Here is the caller graph for this function:

◆ getCriterionTypeMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionTypeMock ( string  $typeIdent)
protected
Parameters
string$typeIdent
Returns
MockObject|ilTermsOfServiceCriterionType
Exceptions
ReflectionException

Definition at line 83 of file ilTermsOfServiceEvaluationBaseTest.php.

84 {
85 $criterionType = $this
86 ->getMockBuilder(ilTermsOfServiceCriterionType::class)
87 ->getMock();
88
89 $criterionType
90 ->expects($this->any())
91 ->method('getTypeIdent')
92 ->willReturn($typeIdent);
93
94 return $criterionType;
95 }
Interface ilTermsOfServiceCriterionType.

Referenced by ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsFalseIfAnyCriteriaAttachedToADocumentDoesNotMatch(), and ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfAllCriteriaAttachedToADocumentMatch().

+ Here is the caller graph for this function:

◆ getEvaluatorMock()

◆ getLogMock()

ilTermsOfServiceEvaluationBaseTest::getLogMock ( )
protected

◆ getUserMock()

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

Definition at line 16 of file ilTermsOfServiceEvaluationBaseTest.php.

16 : ilObjUser
17 {
18 $user = $this
19 ->getMockBuilder(ilObjUser::class)
20 ->disableOriginalConstructor()
21 ->setMethods(['getLanguage', 'getId', 'getLogin'])
22 ->getMock();
23
24 $user
25 ->expects($this->any())
26 ->method('getId')
27 ->willReturn(-1);
28
29 $user
30 ->expects($this->any())
31 ->method('getLogin')
32 ->willReturn('phpunit');
33
34 return $user;
35 }

Referenced by ilTermsOfServiceDocumentEvaluationTest\testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer(), ilTermsOfServiceDocumentEvaluationTest\testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation(), ilTermsOfServiceDocumentEvaluationTest\testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll(), ilTermsOfServiceDocumentEvaluationTest\testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded(), ilTermsOfServiceDocumentEvaluationTest\testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded(), ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsFalseIfAnyCriteriaAttachedToADocumentDoesNotMatch(), ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfAllCriteriaAttachedToADocumentMatch(), and ilTermsOfServiceDocumentCriteriaEvaluationTest\testLogicalAndEvaluatorReturnsTrueIfNoCriterionIsAttachedToADocumentAtAll().

+ Here is the caller graph for this function:

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