11 protected function setUp() : void
13 PHPUnit_Framework_Error_Deprecated::$enabled =
false;
18 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
24 $this->db = $DIC[
'ilDB'];
25 $this->tps = $this->createMock(ilOrgUnitObjectTypePositionSetting::class);
26 $this->tps->method(
'getActivationDefault')
36 $this->assertInstanceOf(ilStudyProgrammeSettingsRepository::class, $repo);
45 $set = $repo->createFor(-1);
50 $this->assertEquals($set->getDeadlinePeriod(), 0);
51 $this->assertNull($set->getDeadlineDate());
53 $this->assertNull($set->getValidityOfQualificationDate());
66 $set = $repo->read(-1);
71 $this->assertEquals($set->getDeadlinePeriod(), 0);
72 $this->assertNull($set->getDeadlineDate());
74 $this->assertNull($set->getValidityOfQualificationDate());
82 $set = $repo->read(-1);
87 $this->assertEquals($set->getDeadlinePeriod(), 0);
88 $this->assertNull($set->getDeadlineDate());
90 $this->assertNull($set->getValidityOfQualificationDate());
93 $set->setSubtypeId(123)
97 ->setDeadlinePeriod(10)
98 ->setValidityOfQualificationPeriod(20)
99 ->setRestartPeriod(30);
102 $set = $repo->read(-1);
103 $this->assertEquals($set->getSubtypeId(), 123);
106 $this->assertEquals($set->getPoints(), 10);
107 $this->assertEquals($set->getDeadlinePeriod(), 10);
108 $this->assertNull($set->getDeadlineDate());
109 $this->assertEquals($set->getValidityOfQualificationPeriod(), 20);
110 $this->assertNull($set->getValidityOfQualificationDate());
111 $this->assertEquals($set->getRestartPeriod(), 30);
113 $set->setSubtypeId(123)
115 ->setValidityOfQualificationDate(DateTime::createFromFormat(
'Ymd',
'20200101'))
119 $set = $repo->read(-1);
120 $this->assertEquals($set->getDeadlinePeriod(), 0);
121 $this->assertEquals($set->getDeadlineDate()->format(
'Ymd'), (
new DateTime())->format(
'Ymd'));
122 $this->assertEquals($set->getValidityOfQualificationDate()->format(
'Ymd'),
'20200101');
131 $set = $repo->read(-1);
132 $this->assertEquals($set->getSubtypeId(), 123);
135 $this->assertEquals($set->getPoints(), 10);
148 $set = $repo->read(-1);
149 $this->assertEquals($set->getSubtypeId(), 123);
152 $this->assertEquals($set->getPoints(), 10);
const NO_VALIDITY_OF_QUALIFICATION_PERIOD
test_delete()
test_edit_and_update
test_edit_and_update()
test_create
test_create($repo)
test_init