20 ->getMockBuilder(\ilTermsOfServiceSignableDocument::class)
24 ->expects($this->
once())
28 $evaluator = new \ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation($criterionTypeFactory,
$user,
$log);
30 $this->assertTrue($evaluator->evaluate($doc));
53 ->expects($this->
once())
59 ->expects($this->
once())
65 ->expects($this->
once())
71 ->getMockBuilder(\ilTermsOfServiceSignableDocument::class)
75 ->expects($this->
once())
78 $criterionAssignment1,
79 $criterionAssignment2,
85 ->expects($this->exactly(3))
86 ->method(
'findByTypeIdent')
87 ->willReturnOnConsecutiveCalls(
93 $evaluator = new \ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation($criterionTypeFactory,
$user,
$log);
95 $this->assertTrue($evaluator->evaluate($doc));
118 ->expects($this->
once())
124 ->expects($this->
once())
130 ->expects($this->never())
136 ->getMockBuilder(\ilTermsOfServiceSignableDocument::class)
140 ->expects($this->
once())
143 $criterionAssignment1,
144 $criterionAssignment2,
145 $criterionAssignment3
149 $criterionTypeFactory
150 ->expects($this->exactly(2))
151 ->method(
'findByTypeIdent')
152 ->willReturnOnConsecutiveCalls(
158 $evaluator = new \ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation($criterionTypeFactory,
$user,
$log);
160 $this->assertFalse($evaluator->evaluate($doc));
getCriterionTypeMock(string $typeIdent)
testLogicalAndEvaluatorReturnsTrueIfNoCriterionIsAttachedToADocumentAtAll()
testLogicalAndEvaluatorReturnsTrueIfAllCriteriaAttachedToADocumentMatch()
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
Class ilTermsOfServiceDocumentCriteriaEvaluationTest.
getCriterionTypeFactoryMock()
getCriterionAssignmentMock(\ilTermsOfServiceCriterionType $criterionType)
Class ilTermsOfServiceEvaluationBaseTest.
testLogicalAndEvaluatorReturnsFalseIfAnyCriteriaAttachedToADocumentDoesNotMatch()