ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilIndividualAssessmentUserGradingTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
29 {
30  public function test_create_instance()
31  {
32  $name = 'Hans Günther';
33  $record = 'The guy was really good';
34  $internal_note = 'This is a node just for me.';
35  $file = null;
36  $is_file_visible = false;
38  $place = 'Area 51';
39  $event_time = new DateTimeImmutable();
40  $notify = true;
41  $finalized = false;
42  $grading = new ilIndividualAssessmentUserGrading(
43  $name,
44  $record,
45  $internal_note,
46  $file,
47  $is_file_visible,
49  $place,
50  $event_time,
51  $notify,
52  $finalized
53  );
54 
55  $this->assertInstanceOf(ilIndividualAssessmentUserGrading::class, $grading);
56  $this->assertEquals($name, $grading->getName());
57  $this->assertEquals($record, $grading->getRecord());
58  $this->assertEquals($internal_note, $grading->getInternalNote());
59  $this->assertNull($grading->getFile());
60  $this->assertFalse($grading->isFileVisible());
61  $this->assertEquals($learning_progress, $grading->getLearningProgress());
62  $this->assertEquals($place, $grading->getPlace());
63  $this->assertEquals($event_time, $grading->getEventTime());
64  $this->assertTrue($grading->isNotify());
65  $this->assertFalse($grading->isFinalized());
66  }
67 
68  public function test_with_finalized_changed()
69  {
70  $name = 'Hans Günther';
71  $record = 'The guy was really good';
72  $internal_note = 'This is a node just for me.';
73  $file = 'report.pdf';
74  $is_file_visible = true;
76  $place = 'Area 51 Underground';
77  $event_time = new DateTimeImmutable();
78  $notify = false;
79  $finalized = false;
80  $grading = new ilIndividualAssessmentUserGrading(
81  $name,
82  $record,
83  $internal_note,
84  $file,
85  $is_file_visible,
87  $place,
88  $event_time,
89  $notify,
90  $finalized
91  );
92 
93  $this->assertInstanceOf(ilIndividualAssessmentUserGrading::class, $grading);
94  $this->assertEquals($name, $grading->getName());
95  $this->assertEquals($record, $grading->getRecord());
96  $this->assertEquals($internal_note, $grading->getInternalNote());
97  $this->assertEquals($file, $grading->getFile());
98  $this->assertTrue($grading->isFileVisible());
99  $this->assertEquals($learning_progress, $grading->getLearningProgress());
100  $this->assertEquals($place, $grading->getPlace());
101  $this->assertEquals($event_time, $grading->getEventTime());
102  $this->assertFalse($grading->isNotify());
103  $this->assertFalse($grading->isFinalized());
104 
105  $n_grading = $grading->withFinalized(true);
106  $this->assertEquals($name, $n_grading->getName());
107  $this->assertEquals($record, $n_grading->getRecord());
108  $this->assertEquals($internal_note, $n_grading->getInternalNote());
109  $this->assertEquals($file, $n_grading->getFile());
110  $this->assertTrue($n_grading->isFileVisible());
111  $this->assertEquals($learning_progress, $n_grading->getLearningProgress());
112  $this->assertEquals($place, $n_grading->getPlace());
113  $this->assertEquals($event_time, $n_grading->getEventTime());
114  $this->assertFalse($n_grading->isNotify());
115  $this->assertTrue($n_grading->isFinalized());
116 
117  $this->assertNotSame($n_grading, $grading);
118  }
119 
120  public function testToFormInput(): void
121  {
122  $lng = $this->createMock(ilLanguage::class);
123  $lng->expects($this->atLeastOnce())
124  ->method('txt')
125  ->willReturn("label")
126  ;
127  $file_handler = $this->createMock(AbstractCtrlAwareUploadHandler::class);
128  $df = new ILIAS\Data\Factory();
131  $this->createMock(\ILIAS\UI\Implementation\Component\Input\UploadLimitResolver::class),
132  new ILIAS\UI\Implementation\Component\SignalGenerator(),
133  $df,
134  $refinery,
135  $lng
136  );
137 
138  $name = 'Hans Günther';
139  $record = 'The guy was really good';
140  $internal_note = 'This is a node just for me.';
141  $file = 'report.pdf';
142  $is_file_visible = true;
144  $place = 'Area 51 Underground';
145  $event_time = new DateTimeImmutable();
146  $notify = false;
147  $finalized = false;
148  $record_template = "Record Template";
149  $grading = new ilIndividualAssessmentUserGrading(
150  $name,
151  $record,
152  $internal_note,
153  $file,
154  $is_file_visible,
156  $place,
157  $event_time,
158  $notify,
159  $finalized
160  );
161 
162  $input = $grading->toFormInput(
163  $f,
164  $df,
165  $lng,
166  $refinery,
167  $file_handler,
168  $df->dateFormat()->standard(),
169  $record_template,
170  [
174  ]
175  );
176 
177  $this->assertInstanceOf(Section::class, $input);
178  }
179 }
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
bool $notify
$learning_progress
Definition: plugin.php:29
global $lng
Definition: privfeed.php:31