ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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
Container $dic
 

Detailed Description

Member Function Documentation

◆ getCriterionAssignmentMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionAssignmentMock ( ilTermsOfServiceCriterionType  $criterionType)
protected
Parameters
ilTermsOfServiceCriterionType$criterionType
Returns
MockObject&ilTermsOfServiceEvaluableCriterion

Definition at line 110 of file ilTermsOfServiceEvaluationBaseTest.php.

References ilTermsOfServiceCriterionType\getTypeIdent().

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

113  $criterionAssignment = $this
114  ->getMockBuilder(ilTermsOfServiceEvaluableCriterion::class)
115  ->getMock();
116 
117  $criterionAssignment
118  ->method('getCriterionId')
119  ->willReturn($criterionType->getTypeIdent());
120 
121  return $criterionAssignment;
122  }
Interface ilTermsOfServiceEvaluableCriterion.
getTypeIdent()
Returns a unique id of the criterion type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCriterionTypeFactoryMock()

◆ getCriterionTypeMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionTypeMock ( string  $typeIdent)
protected
Parameters
string$typeIdent
Returns
MockObject&ilTermsOfServiceCriterionType

Definition at line 93 of file ilTermsOfServiceEvaluationBaseTest.php.

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

94  {
95  $criterionType = $this
96  ->getMockBuilder(ilTermsOfServiceCriterionType::class)
97  ->getMock();
98 
99  $criterionType
100  ->method('getTypeIdent')
101  ->willReturn($typeIdent);
102 
103  return $criterionType;
104  }
Interface ilTermsOfServiceCriterionType.
+ Here is the caller graph for this function:

◆ getEvaluatorMock()

◆ getLogMock()

ilTermsOfServiceEvaluationBaseTest::getLogMock ( )
protected

◆ getUserMock()

ilTermsOfServiceEvaluationBaseTest::getUserMock ( )
protected
Returns
MockObject&ilObjUser

Definition at line 32 of file ilTermsOfServiceEvaluationBaseTest.php.

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

32  : ilObjUser
33  {
34  $user = $this
35  ->getMockBuilder(ilObjUser::class)
36  ->disableOriginalConstructor()
37  ->onlyMethods(['getLanguage', 'getId', 'getLogin'])
38  ->getMock();
39 
40  $user
41  ->method('getId')
42  ->willReturn(-1);
43 
44  $user
45  ->method('getLogin')
46  ->willReturn('phpunit');
47 
48  return $user;
49  }
+ Here is the caller graph for this function:

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