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

Detailed Description

Member Function Documentation

◆ testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer()

ilTermsOfServiceDocumentEvaluationTest::testAskingEvaluatorForDocumentExistenceIfNoDocumentExistAtAllResultsInANegativeAnswer ( )

Definition at line 27 of file ilTermsOfServiceDocumentEvaluationTest.php.

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

27  : void
28  {
29  $evaluator = $this->getEvaluatorMock();
30  $user = $this->getUserMock();
31  $log = $this->getLogMock();
32 
34  $evaluator,
35  $user,
36  $log,
37  []
38  );
39 
40  $this->assertFalse($evaluation->hasDocument());
41  }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:33
+ Here is the call graph for this function:

◆ testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation()

ilTermsOfServiceDocumentEvaluationTest::testDocumentOnArbitraryPositionIsReturnedMatchingFirstDocumentWithASucceededEvaluation ( )

Definition at line 88 of file ilTermsOfServiceDocumentEvaluationTest.php.

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

88  : void
89  {
90  $evaluator = $this->getEvaluatorMock();
91  $user = $this->getUserMock();
92  $log = $this->getLogMock();
93 
94  $doc1 = $this
95  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
96  ->getMock();
97 
98  $doc2 = $this
99  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
100  ->getMock();
101 
102  $doc3 = $this
103  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
104  ->getMock();
105 
106  $evaluator
107  ->expects($this->exactly(3))
108  ->method('evaluate')
109  ->withConsecutive(
110  [$doc1],
111  [$doc2],
112  [$doc3]
113  )
114  ->willReturnMap([
115  [$doc1, false],
116  [$doc2, true],
117  [$doc3, false],
118  ]);
119 
121  $evaluator,
122  $user,
123  $log,
124  [$doc1, $doc2, $doc3]
125  );
126 
127  $this->assertTrue($evaluation->hasDocument());
128  $this->assertSame($doc2, $evaluation->document());
129  }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:33
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll()

ilTermsOfServiceDocumentEvaluationTest::testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll ( )

Definition at line 43 of file ilTermsOfServiceDocumentEvaluationTest.php.

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

43  : void
44  {
45  $evaluator = $this->getEvaluatorMock();
46  $user = $this->getUserMock();
47  $log = $this->getLogMock();
48 
50  $evaluator,
51  $user,
52  $log,
53  []
54  );
55 
56  $this->expectException(ilTermsOfServiceNoSignableDocumentFoundException::class);
57 
58  $evaluation->document();
59  }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:33
+ Here is the call graph for this function:

◆ testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded()

ilTermsOfServiceDocumentEvaluationTest::testFirstDocumentIsReturnedIfEvaluationOfFirstDocumentSucceeded ( )

Definition at line 61 of file ilTermsOfServiceDocumentEvaluationTest.php.

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

61  : void
62  {
63  $evaluator = $this->getEvaluatorMock();
64  $user = $this->getUserMock();
65  $log = $this->getLogMock();
66 
67  $doc = $this
68  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
69  ->getMock();
70 
71  $evaluator
72  ->expects($this->once())
73  ->method('evaluate')
74  ->with($doc)
75  ->willReturn(true);
76 
78  $evaluator,
79  $user,
80  $log,
81  [$doc]
82  );
83 
84  $this->assertTrue($evaluation->hasDocument());
85  $this->assertSame($doc, $evaluation->document());
86  }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:33
+ Here is the call graph for this function:

◆ testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded()

ilTermsOfServiceDocumentEvaluationTest::testFirstMatchingDocumentIsReturnedIfEvaluationOfMultipleDocumentsSucceeded ( )

Definition at line 131 of file ilTermsOfServiceDocumentEvaluationTest.php.

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

131  : void
132  {
133  $evaluator = $this->getEvaluatorMock();
134  $user = $this->getUserMock();
135  $log = $this->getLogMock();
136 
137  $doc1 = $this
138  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
139  ->getMock();
140 
141  $doc2 = $this
142  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
143  ->getMock();
144 
145  $doc3 = $this
146  ->getMockBuilder(ilTermsOfServiceSignableDocument::class)
147  ->getMock();
148 
149  $evaluator
150  ->expects($this->exactly(3))
151  ->method('evaluate')
152  ->withConsecutive(
153  [$doc1],
154  [$doc2],
155  [$doc3]
156  )
157  ->willReturnMap([
158  [$doc1, false],
159  [$doc2, true],
160  [$doc3, true],
161  ]);
162 
164  $evaluator,
165  $user,
166  $log,
167  [$doc1, $doc2, $doc3]
168  );
169 
170  $this->assertTrue($evaluation->hasDocument());
171  $this->assertSame($doc2, $evaluation->document());
172  }
Interface ilTermsOfServiceSequentialDocumentEvaluation.
$log
Definition: result.php:33
+ Here is the call graph for this function:

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