ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilStudyProgrammeSubSettingsTest Class Reference

Tests for: ilStudyProgrammeTypeSettings ilStudyProgrammeAssessmentSettings ilStudyProgrammeDeadlineSettings ilStudyProgrammeValidityOfAchievedQualificationSettings ilStudyProgrammeAutoMailSettings. More...

+ Inheritance diagram for ilStudyProgrammeSubSettingsTest:
+ Collaboration diagram for ilStudyProgrammeSubSettingsTest:

Public Member Functions

 setUp ()
 
 testPRGSettingsType ()
 
 testPRGSettingsTypeToForm ()
 
 testPRGSettingsAssessment ()
 
 testPRGSettingsAssessmentToForm ()
 
 testPRGSettingsDeadline ()
 
 testPRGSettingsDeadlineToForm ()
 
 testPRGSettingsValidity ()
 
 testPRGSettingsValidityToForm ()
 
 testPRGSettingsMail ()
 
 testPRGSettingsMailToForm ()
 

Protected Attributes

ilLanguage $lng
 
Refinery $refinery
 
FieldFactory $field_factory
 
DataFactory $data_factory
 

Detailed Description

Member Function Documentation

◆ setUp()

ilStudyProgrammeSubSettingsTest::setUp ( )

Definition at line 43 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

43  : void
44  {
45  $this->data_factory = new DataFactory();
46  $this->lng = $this->createMock(ilLanguage::class);
47  $this->refinery = new Refinery($this->data_factory, $this->lng);
48  $this->field_factory = new FieldFactory(
49  $this->createMock(UploadLimitResolver::class),
50  new SignalGenerator(),
51  $this->data_factory,
52  $this->refinery,
53  $this->lng
54  );
55  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testPRGSettingsAssessment()

ilStudyProgrammeSubSettingsTest::testPRGSettingsAssessment ( )

Definition at line 78 of file ilStudyProgrammeSubSettingsTest.php.

References ilStudyProgrammeAssessmentSettings\STATUS_ACTIVE, and ilStudyProgrammeAssessmentSettings\STATUS_DRAFT.

78  : void
79  {
81  $this->assertEquals(12, $settings->getPoints());
82  $this->assertEquals(13, $settings->withPoints(13)->getPoints());
83  $this->assertEquals(ilStudyProgrammeAssessmentSettings::STATUS_DRAFT, $settings->getStatus());
84  $this->assertEquals(
86  $settings->withStatus(ilStudyProgrammeAssessmentSettings::STATUS_ACTIVE)->getStatus()
87  );
88  }

◆ testPRGSettingsAssessmentToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsAssessmentToForm ( )

Definition at line 90 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilStudyProgrammeAssessmentSettings\STATUS_DRAFT.

90  : void
91  {
93  $section = $settings->toFormInput(
94  $this->field_factory,
95  $this->lng,
96  $this->refinery
97  );
98  $this->assertInstanceOf(Field\Section::class, $section);
99  $inputs = $section->getInputs();
100  $this->assertInstanceOf(Field\Numeric::class, array_shift($inputs));
101  $this->assertInstanceOf(Field\Select::class, array_shift($inputs));
102  }
+ Here is the call graph for this function:

◆ testPRGSettingsDeadline()

ilStudyProgrammeSubSettingsTest::testPRGSettingsDeadline ( )

Definition at line 104 of file ilStudyProgrammeSubSettingsTest.php.

References null.

104  : void
105  {
106  $settings = new ilStudyProgrammeDeadlineSettings(2, null);
107  $this->assertEquals(2, $settings->getDeadlinePeriod());
108  $this->assertEquals(13, $settings->withDeadlinePeriod(13)->getDeadlinePeriod());
109  $this->assertNull($settings->getDeadlineDate());
110  $dat = new \DateTimeImmutable();
111  $this->assertEquals($dat, $settings->withDeadlineDate($dat)->getDeadlineDate());
112  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testPRGSettingsDeadlineToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsDeadlineToForm ( )

Definition at line 114 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), null, and ILIAS\Repository\refinery().

114  : void
115  {
116  $settings = new ilStudyProgrammeDeadlineSettings(null, null);
117  $section = $settings->toFormInput(
118  $this->field_factory,
119  $this->lng,
120  $this->refinery,
121  $this->data_factory
122  );
123  $this->assertInstanceOf(Field\Section::class, $section);
124  $group = $section->getInputs();
125  $this->assertInstanceOf(Field\SwitchableGroup::class, current($group));
126  $inputs = current($group)->getInputs();
127  $group1 = array_shift($inputs);
128  $this->assertEquals([], $group1->getInputs());
129  $group2 = array_shift($inputs);
130  $g_inputs = $group2->getInputs();
131  $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
132  $group3 = array_shift($inputs);
133  $g_inputs = $group3->getInputs();
134  $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
135  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ testPRGSettingsMail()

ilStudyProgrammeSubSettingsTest::testPRGSettingsMail ( )

Definition at line 182 of file ilStudyProgrammeSubSettingsTest.php.

References null.

182  : void
183  {
184  $settings = new ilStudyProgrammeAutoMailSettings(false, null, null);
185  $this->assertTrue($settings->withSendReAssignedMail(true)->getSendReAssignedMail());
186  $this->assertEquals(31, $settings->withReminderNotRestartedByUserDays(31)->getReminderNotRestartedByUserDays());
187  $this->assertEquals(60, $settings->withProcessingEndsNotSuccessfulDays(60)->getProcessingEndsNotSuccessfulDays());
188  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testPRGSettingsMailToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsMailToForm ( )

Definition at line 190 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), null, and ILIAS\Repository\refinery().

190  : void
191  {
192  $settings = new ilStudyProgrammeAutoMailSettings(false, null, null);
193  $section = $settings->toFormInput(
194  $this->field_factory,
195  $this->lng,
196  $this->refinery
197  );
198  $this->assertInstanceOf(Field\Section::class, $section);
199  $inputs = $section->getInputs();
200  $this->assertInstanceOf(Field\Checkbox::class, array_shift($inputs));
201  $opt = array_shift($inputs);
202  $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
203  $g_inputs = $opt->getInputs();
204  $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
205  $opt = array_shift($inputs);
206  $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
207  $g_inputs = $opt->getInputs();
208  $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
209  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ testPRGSettingsType()

ilStudyProgrammeSubSettingsTest::testPRGSettingsType ( )

Definition at line 57 of file ilStudyProgrammeSubSettingsTest.php.

57  : void
58  {
59  $settings = new ilStudyProgrammeTypeSettings(765);
60  $this->assertEquals(765, $settings->getTypeId());
61  $this->assertEquals(777, $settings->withTypeId(777)->getTypeId());
62  }

◆ testPRGSettingsTypeToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsTypeToForm ( )

Definition at line 64 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

64  : void
65  {
66  $settings = new ilStudyProgrammeTypeSettings(0);
67  $section = $settings->toFormInput(
68  $this->field_factory,
69  $this->lng,
70  $this->refinery,
71  [3 => 'AA', 7 => 'BB']
72  );
73  $this->assertInstanceOf(Field\Section::class, $section);
74  $inputs = $section->getInputs();
75  $this->assertInstanceOf(Field\Select::class, array_shift($inputs));
76  }
+ Here is the call graph for this function:

◆ testPRGSettingsValidity()

ilStudyProgrammeSubSettingsTest::testPRGSettingsValidity ( )

Definition at line 137 of file ilStudyProgrammeSubSettingsTest.php.

References null.

137  : void
138  {
140  $this->assertEquals(365, $settings->withQualificationPeriod(365)->getQualificationPeriod());
141  $dat = new \DateTimeImmutable();
142  $this->assertEquals($dat, $settings->withQualificationDate($dat)->getQualificationDate());
143  $this->assertEquals(31, $settings->withRestartPeriod(31)->getRestartPeriod());
144  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testPRGSettingsValidityToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsValidityToForm ( )

Definition at line 146 of file ilStudyProgrammeSubSettingsTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), null, and ILIAS\Repository\refinery().

146  : void
147  {
149  $section = $settings->toFormInput(
150  $this->field_factory,
151  $this->lng,
152  $this->refinery,
153  $this->data_factory
154  );
155  $this->assertInstanceOf(Field\Section::class, $section);
156 
157  $groups = $section->getInputs();
158  $sg1 = array_shift($groups);
159  $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
160  $sg2 = array_shift($groups);
161  $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
162 
163  $inputs = $sg1->getInputs();
164  $group1 = array_shift($inputs);
165  $this->assertEquals([], $group1->getInputs());
166  $group2 = array_shift($inputs);
167  $g_inputs = $group2->getInputs();
168  $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
169  $group3 = array_shift($inputs);
170  $g_inputs = $group3->getInputs();
171  $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
172 
173  $inputs = $sg2->getInputs();
174  $group4 = array_shift($inputs);
175  $this->assertEquals([], $group4->getInputs());
176  $group5 = array_shift($inputs);
177  $g5_inputs = $group5->getInputs();
178  $this->assertInstanceOf(Field\Numeric::class, array_shift($g5_inputs));
179  $this->assertInstanceOf(Field\Checkbox::class, array_shift($g5_inputs));
180  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ $data_factory

DataFactory ilStudyProgrammeSubSettingsTest::$data_factory
protected

Definition at line 41 of file ilStudyProgrammeSubSettingsTest.php.

◆ $field_factory

FieldFactory ilStudyProgrammeSubSettingsTest::$field_factory
protected

Definition at line 40 of file ilStudyProgrammeSubSettingsTest.php.

◆ $lng

ilLanguage ilStudyProgrammeSubSettingsTest::$lng
protected

Definition at line 38 of file ilStudyProgrammeSubSettingsTest.php.

◆ $refinery

Refinery ilStudyProgrammeSubSettingsTest::$refinery
protected

Definition at line 39 of file ilStudyProgrammeSubSettingsTest.php.


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