ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTermsOfServiceDocumentEvaluationTest Class Reference

Class ilTermsOfServiceAcceptanceEntityTest. More...

+ Inheritance diagram for ilTermsOfServiceDocumentEvaluationTest:
+ Collaboration diagram for ilTermsOfServiceDocumentEvaluationTest:

Public Member Functions

 testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer ()
 
 testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll ()
 
 testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded ()
 
 testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation ()
 
 testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilTermsOfServiceEvaluationBaseTest
 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)
 
- Protected Attributes inherited from ilTermsOfServiceBaseTest
 $dic
 

Detailed Description

Member Function Documentation

◆ testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer()

ilTermsOfServiceDocumentEvaluationTest::testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer ( )
Exceptions
ReflectionException

Definition at line 13 of file ilTermsOfServiceDocumentEvaluationTest.php.

13 : void
14 {
15 $evaluator = $this->getEvaluatorMock();
16 $user = $this->getUserMock();
17 $log = $this->getLogMock();
18
20 $evaluator,
21 $user,
22 $log,
23 []
24 );
25
26 $this->assertFalse($evaluation->hasDocument());
27 }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:15

References $log, ilTermsOfServiceEvaluationBaseTest\getEvaluatorMock(), ilTermsOfServiceEvaluationBaseTest\getLogMock(), and ilTermsOfServiceEvaluationBaseTest\getUserMock().

+ Here is the call graph for this function:

◆ testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation()

ilTermsOfServiceDocumentEvaluationTest::testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation ( )
Exceptions
ReflectionException
ilTermsOfServiceNoSignableDocumentFoundException

Definition at line 86 of file ilTermsOfServiceDocumentEvaluationTest.php.

86 : void
87 {
88 $evaluator = $this->getEvaluatorMock();
89 $user = $this->getUserMock();
90 $log = $this->getLogMock();
91
92 $doc1 = $this
93 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
94 ->getMock();
95
96 $doc2 = $this
97 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
98 ->getMock();
99
100 $doc3 = $this
101 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
102 ->getMock();
103
104 $evaluator
105 ->expects($this->exactly(3))
106 ->method('evaluate')
107 ->withConsecutive(
108 [$doc1],
109 [$doc2],
110 [$doc3]
111 )
112 ->will($this->returnValueMap([
113 [$doc1, false],
114 [$doc2, true],
115 [$doc3, false],
116 ]));
117
119 $evaluator,
120 $user,
121 $log,
122 [$doc1, $doc2, $doc3]
123 );
124
125 $this->assertTrue($evaluation->hasDocument());
126 $this->assertEquals($doc2, $evaluation->document());
127 }

References $log, ilTermsOfServiceEvaluationBaseTest\getEvaluatorMock(), ilTermsOfServiceEvaluationBaseTest\getLogMock(), and ilTermsOfServiceEvaluationBaseTest\getUserMock().

+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll()

ilTermsOfServiceDocumentEvaluationTest::testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll ( )
Exceptions
ReflectionException
ilTermsOfServiceNoSignableDocumentFoundException

Definition at line 33 of file ilTermsOfServiceDocumentEvaluationTest.php.

33 : void
34 {
35 $evaluator = $this->getEvaluatorMock();
36 $user = $this->getUserMock();
37 $log = $this->getLogMock();
38
40 $evaluator,
41 $user,
42 $log,
43 []
44 );
45
46 $this->expectException(ilTermsOfServiceNoSignableDocumentFoundException::class);
47
48 $evaluation->document();
49 }

References $log, ilTermsOfServiceEvaluationBaseTest\getEvaluatorMock(), ilTermsOfServiceEvaluationBaseTest\getLogMock(), and ilTermsOfServiceEvaluationBaseTest\getUserMock().

+ Here is the call graph for this function:

◆ testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded()

ilTermsOfServiceDocumentEvaluationTest::testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded ( )
Exceptions
ReflectionException
ilTermsOfServiceNoSignableDocumentFoundException

Definition at line 55 of file ilTermsOfServiceDocumentEvaluationTest.php.

55 : void
56 {
57 $evaluator = $this->getEvaluatorMock();
58 $user = $this->getUserMock();
59 $log = $this->getLogMock();
60
61 $doc = $this
62 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
63 ->getMock();
64
65 $evaluator
66 ->expects($this->exactly(1))
67 ->method('evaluate')
68 ->with($doc)
69 ->willReturn(true);
70
72 $evaluator,
73 $user,
74 $log,
75 [$doc]
76 );
77
78 $this->assertTrue($evaluation->hasDocument());
79 $this->assertEquals($doc, $evaluation->document());
80 }

References $log, ilTermsOfServiceEvaluationBaseTest\getEvaluatorMock(), ilTermsOfServiceEvaluationBaseTest\getLogMock(), and ilTermsOfServiceEvaluationBaseTest\getUserMock().

+ Here is the call graph for this function:

◆ testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded()

ilTermsOfServiceDocumentEvaluationTest::testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded ( )
Exceptions
ReflectionException
ilTermsOfServiceNoSignableDocumentFoundException

Definition at line 133 of file ilTermsOfServiceDocumentEvaluationTest.php.

133 : void
134 {
135 $evaluator = $this->getEvaluatorMock();
136 $user = $this->getUserMock();
137 $log = $this->getLogMock();
138
139 $doc1 = $this
140 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
141 ->getMock();
142
143 $doc2 = $this
144 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
145 ->getMock();
146
147 $doc3 = $this
148 ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
149 ->getMock();
150
151 $evaluator
152 ->expects($this->exactly(3))
153 ->method('evaluate')
154 ->withConsecutive(
155 [$doc1],
156 [$doc2],
157 [$doc3]
158 )
159 ->will($this->returnValueMap([
160 [$doc1, false],
161 [$doc2, true],
162 [$doc3, true],
163 ]));
164
166 $evaluator,
167 $user,
168 $log,
169 [$doc1, $doc2, $doc3]
170 );
171
172 $this->assertTrue($evaluation->hasDocument());
173 $this->assertEquals($doc2, $evaluation->document());
174 }

References $log, ilTermsOfServiceEvaluationBaseTest\getEvaluatorMock(), ilTermsOfServiceEvaluationBaseTest\getLogMock(), and ilTermsOfServiceEvaluationBaseTest\getUserMock().

+ Here is the call graph for this function:

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