ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 setGlobalVariable (string $name, $value)
 
 assertException (string $exceptionClass)
 
 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
PHPUnit_Framework_MockObject_MockObject|

Definition at line 94 of file ilTermsOfServiceEvaluationBaseTest.php.

References ilTermsOfServiceCriterionType\getTypeIdent().

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

95  {
96  $criterionAssignment = $this
97  ->getMockBuilder(\ilTermsOfServiceEvaluableCriterion::class)
98  ->getMock();
99 
100  $criterionAssignment
101  ->expects($this->any())
102  ->method('getCriterionId')
103  ->willReturn($criterionType->getTypeIdent());
104 
105  return $criterionAssignment;
106  }
Interface ilTermsOfServiceEvaluableCriterion.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCriterionTypeFactoryMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionTypeFactoryMock ( )
protected
Returns
PHPUnit_Framework_MockObject_MockObject|

Definition at line 63 of file ilTermsOfServiceEvaluationBaseTest.php.

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

64  {
65  $criterionTypeFactory = $this
66  ->getMockBuilder(\ilTermsOfServiceCriterionTypeFactoryInterface::class)
67  ->getMock();
68 
69  return $criterionTypeFactory;
70  }
+ Here is the caller graph for this function:

◆ getCriterionTypeMock()

ilTermsOfServiceEvaluationBaseTest::getCriterionTypeMock ( string  $typeIdent)
protected
Parameters
string$typeIdent
Returns
PHPUnit_Framework_MockObject_MockObject|

Definition at line 76 of file ilTermsOfServiceEvaluationBaseTest.php.

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

77  {
78  $criterionType = $this
79  ->getMockBuilder(\ilTermsOfServiceCriterionType::class)
80  ->getMock();
81 
82  $criterionType
83  ->expects($this->any())
84  ->method('getTypeIdent')
85  ->willReturn($typeIdent);
86 
87  return $criterionType;
88  }
Interface ilTermsOfServiceCriterionType.
+ Here is the caller graph for this function:

◆ getEvaluatorMock()

◆ getLogMock()

ilTermsOfServiceEvaluationBaseTest::getLogMock ( )
protected

◆ getUserMock()

ilTermsOfServiceEvaluationBaseTest::getUserMock ( )
protected
Returns
PHPUnit_Framework_MockObject_MockObject|

Definition at line 13 of file ilTermsOfServiceEvaluationBaseTest.php.

References $user.

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

13  : \ilObjUser
14  {
15  $user = $this
16  ->getMockBuilder(\ilObjUser::class)
17  ->disableOriginalConstructor()
18  ->setMethods(['getLanguage', 'getId', 'getLogin'])
19  ->getMock();
20 
21  $user
22  ->expects($this->any())
23  ->method('getId')
24  ->willReturn(-1);
25 
26  $user
27  ->expects($this->any())
28  ->method('getLogin')
29  ->willReturn('phpunit');
30 
31  return $user;
32  }
$user
Definition: migrateto20.php:57
+ Here is the caller graph for this function:

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