ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeSettingsTest Class Reference

needsInstalledILIAS More...

+ Inheritance diagram for ilStudyProgrammeSettingsTest:
+ Collaboration diagram for ilStudyProgrammeSettingsTest:

Public Member Functions

 setUp ()
 
 test_init_and_id ()
 
 test_subtype_id ($sps)
 test_init_and_id More...
 
 test_points ($sps)
 test_init_and_id More...
 
 test_wrong_points ($sps)
 test_init_and_id ilException More...
 
 test_lp_mode ($sps)
 test_init_and_id More...
 
 test_wrong_lp_mode ($sps)
 test_init_and_id ilException More...
 
 test_status ($sps)
 test_init_and_id More...
 
 test_wrong_status ($sps)
 test_init_and_id ilException More...
 
 test_deadline_period ($sps)
 test_init_and_id More...
 
 test_deadline_date ($sps)
 test_init_and_id More...
 
 test_validity_qualification_period ($sps)
 test_init_and_id More...
 
 test_validity_qualification_date ($sps)
 test_init_and_id More...
 
 test_wrong_vq_peiod ($sps)
 test_init_and_id ilException More...
 
 test_restart_period ($sps)
 test_init_and_id More...
 
 test_wrong_restart_period ($sps)
 test_init_and_id ilException More...
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

needsInstalledILIAS

Definition at line 6 of file ilStudyProgrammeSettingsTest.php.

Member Function Documentation

◆ setUp()

ilStudyProgrammeSettingsTest::setUp ( )

Definition at line 10 of file ilStudyProgrammeSettingsTest.php.

References $DIC, Vendor\Package\$e, and ILIAS\LTI\ToolProvider\$enabled.

10  : void
11  {
13 
14  global $DIC;
15  if (!$DIC) {
16  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
17  try {
18  ilUnitUtil::performInitialisation();
19  } catch (\Exception $e) {
20  }
21  }
22  }
bool $enabled
Whether the system instance is enabled to accept connection requests.
Definition: System.php:123
global $DIC
Definition: feed.php:28

◆ test_deadline_date()

ilStudyProgrammeSettingsTest::test_deadline_date (   $sps)

test_init_and_id

Definition at line 125 of file ilStudyProgrammeSettingsTest.php.

126  {
127  $this->assertEquals($sps->setDeadlineDate(new \DateTime())->getDeadlineDate()->format('Ymd'), (new \DateTime())->format('Ymd'));
128  $this->assertNull($sps->setDeadlinePeriod(10)->getDeadlineDate());
129  }

◆ test_deadline_period()

ilStudyProgrammeSettingsTest::test_deadline_period (   $sps)

test_init_and_id

Definition at line 116 of file ilStudyProgrammeSettingsTest.php.

117  {
118  $this->assertEquals($sps->setDeadlinePeriod(10)->getDeadlinePeriod(), 10);
119  $this->assertEquals($sps->setDeadlineDate(new \DateTime())->getDeadlinePeriod(), 0);
120  }

◆ test_init_and_id()

ilStudyProgrammeSettingsTest::test_init_and_id ( )

Definition at line 25 of file ilStudyProgrammeSettingsTest.php.

26  {
27  $sps = new ilStudyProgrammeSettings(123);
28  $this->assertEquals($sps->getObjId(), 123);
29  return $sps;
30  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ test_lp_mode()

ilStudyProgrammeSettingsTest::test_lp_mode (   $sps)

◆ test_points()

ilStudyProgrammeSettingsTest::test_points (   $sps)

test_init_and_id

Definition at line 43 of file ilStudyProgrammeSettingsTest.php.

44  {
45  $this->assertEquals($sps->setPoints(3)->getPoints(), 3);
46  }

◆ test_restart_period()

ilStudyProgrammeSettingsTest::test_restart_period (   $sps)

test_init_and_id

Definition at line 161 of file ilStudyProgrammeSettingsTest.php.

162  {
163  $this->assertEquals($sps->setRestartPeriod(10)->getRestartPeriod(), 10);
164  }

◆ test_status()

ilStudyProgrammeSettingsTest::test_status (   $sps)

test_init_and_id

Definition at line 88 of file ilStudyProgrammeSettingsTest.php.

References ilStudyProgrammeSettings\STATUS_ACTIVE, ilStudyProgrammeSettings\STATUS_DRAFT, and ilStudyProgrammeSettings\STATUS_OUTDATED.

89  {
90  $this->assertEquals(
91  $sps->setStatus(ilStudyProgrammeSettings::STATUS_DRAFT)->getStatus(),
93  );
94  $this->assertEquals(
95  $sps->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE)->getStatus(),
97  );
98  $this->assertEquals(
99  $sps->setStatus(ilStudyProgrammeSettings::STATUS_OUTDATED)->getStatus(),
101  );
102  }

◆ test_subtype_id()

ilStudyProgrammeSettingsTest::test_subtype_id (   $sps)

test_init_and_id

Definition at line 35 of file ilStudyProgrammeSettingsTest.php.

36  {
37  $this->assertEquals($sps->setSubtypeId(2)->getSubtypeId(), 2);
38  }

◆ test_validity_qualification_date()

ilStudyProgrammeSettingsTest::test_validity_qualification_date (   $sps)

test_init_and_id

Definition at line 143 of file ilStudyProgrammeSettingsTest.php.

144  {
145  $this->assertEquals($sps->setValidityOfQualificationDate(new \DateTime())->getValidityOfQualificationDate()->format('Ymd'), (new \DateTime())->format('Ymd'));
146  $this->assertNull($sps->setValidityOfQualificationPeriod(10)->getValidityOfQualificationDate());
147  }

◆ test_validity_qualification_period()

ilStudyProgrammeSettingsTest::test_validity_qualification_period (   $sps)

test_init_and_id

Definition at line 134 of file ilStudyProgrammeSettingsTest.php.

References ilStudyProgrammeSettings\NO_VALIDITY_OF_QUALIFICATION_PERIOD.

135  {
136  $this->assertEquals($sps->setValidityOfQualificationPeriod(10)->getValidityOfQualificationPeriod(), 10);
137  $this->assertEquals($sps->setValidityOfQualificationDate(new \DateTime())->getValidityOfQualificationPeriod(), ilStudyProgrammeSettings::NO_VALIDITY_OF_QUALIFICATION_PERIOD);
138  }

◆ test_wrong_lp_mode()

ilStudyProgrammeSettingsTest::test_wrong_lp_mode (   $sps)

test_init_and_id ilException

Definition at line 80 of file ilStudyProgrammeSettingsTest.php.

81  {
82  $sps->setLPMode(4)->getLPMode();
83  }

◆ test_wrong_points()

ilStudyProgrammeSettingsTest::test_wrong_points (   $sps)

test_init_and_id ilException

Definition at line 52 of file ilStudyProgrammeSettingsTest.php.

53  {
54  $sps->setPoints(-3);
55  }

◆ test_wrong_restart_period()

ilStudyProgrammeSettingsTest::test_wrong_restart_period (   $sps)

test_init_and_id ilException

Definition at line 170 of file ilStudyProgrammeSettingsTest.php.

171  {
172  $sps->setRestartPeriod(-10);
173  }

◆ test_wrong_status()

ilStudyProgrammeSettingsTest::test_wrong_status (   $sps)

test_init_and_id ilException

Definition at line 108 of file ilStudyProgrammeSettingsTest.php.

109  {
110  $sps->setStatus(41);
111  }

◆ test_wrong_vq_peiod()

ilStudyProgrammeSettingsTest::test_wrong_vq_peiod (   $sps)

test_init_and_id ilException

Definition at line 153 of file ilStudyProgrammeSettingsTest.php.

154  {
155  $sps->setValidityOfQualificationPeriod(-10);
156  }

Field Documentation

◆ $backupGlobals

ilStudyProgrammeSettingsTest::$backupGlobals = false
protected

Definition at line 8 of file ilStudyProgrammeSettingsTest.php.


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