19 declare(strict_types=1);
27 protected function setUp(): void
29 $this->db = $this->createMock(ilDBInterface::class);
30 $this->tps = $this->createMock(ilOrgUnitObjectTypePositionSetting::class);
31 $this->tps->method(
'getActivationDefault')
41 $this->assertInstanceOf(ilStudyProgrammeSettingsRepository::class, $repo);
50 $this->markTestSkipped(
'Failed for some unknown reason.');
61 $this->assertEquals($set->getDeadlineSettings()->getDeadlinePeriod(), 0);
62 $this->assertNull($set->getDeadlineSettings()->getDeadlineDate());
64 $this->assertNull($set->getValidityOfQualificationSettings()->getQualificationDate());
72 $set = $repo->get(-1);
77 $this->assertEquals($set->getDeadlinePeriod(), 0);
78 $this->assertNull($set->getDeadlineDate());
80 $this->assertNull($set->getValidityOfQualificationDate());
83 $set->setSubtypeId(123)
87 ->setDeadlinePeriod(10)
88 ->setValidityOfQualificationPeriod(20)
89 ->setRestartPeriod(30);
92 $set = $repo->get(-1);
93 $this->assertEquals($set->getSubtypeId(), 123);
96 $this->assertEquals($set->getPoints(), 10);
97 $this->assertEquals($set->getDeadlinePeriod(), 10);
98 $this->assertNull($set->getDeadlineDate());
99 $this->assertEquals($set->getValidityOfQualificationPeriod(), 20);
100 $this->assertNull($set->getValidityOfQualificationDate());
101 $this->assertEquals($set->getRestartPeriod(), 30);
103 $set->setSubtypeId(123)
105 ->setValidityOfQualificationDate(DateTime::createFromFormat(
'Ymd',
'20200101'))
109 $set = $repo->get(-1);
110 $this->assertEquals($set->getDeadlinePeriod(), 0);
111 $this->assertEquals($set->getDeadlineDate()->format(
'Ymd'), (
new DateTime())->format(
'Ymd'));
112 $this->assertEquals($set->getValidityOfQualificationDate()->format(
'Ymd'),
'20200101');
121 $set = $repo->get(-1);
122 $this->assertEquals($set->getSubtypeId(), 123);
125 $this->assertEquals($set->getPoints(), 10);
133 $this->expectException(\LogicException::class);
138 $set = $repo->get(-1);
139 $this->assertEquals($set->getSubtypeId(), 123);
142 $this->assertEquals($set->getPoints(), 10);
testPRGRepoDelete()
testPRGRepoEditAndUpdate
createFor(int $obj_id)
Create a record corresponding to a SP-Object and return representing settings.Will throw if a record ...
const NO_VALIDITY_OF_QUALIFICATION_PERIOD
ilOrgUnitObjectTypePositionSetting $tps
testPRGRepoEditAndUpdate(ilStudyProgrammeSettingsDBRepository $repo)
test_init
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...