Definition at line 31 of file ilLearnerProgressDBTest.php.
◆ setUp()
ilLearnerProgressDBTest::setUp |
( |
| ) |
|
|
protected |
◆ testCreateObject()
ilLearnerProgressDBTest::testCreateObject |
( |
| ) |
|
◆ testGetLearnerItemsWithNonVisibleLSItem()
ilLearnerProgressDBTest::testGetLearnerItemsWithNonVisibleLSItem |
( |
| ) |
|
Definition at line 67 of file ilLearnerProgressDBTest.php.
References ILIAS\Repository\access().
69 $ls_item = $this->createMock(LSItem::class);
72 ->expects($this->once())
77 ->expects($this->once())
83 ->expects($this->once())
84 ->method(
'checkAccessOfUser')
85 ->with(100,
'visible',
'', 33)
90 ->expects($this->once())
91 ->method(
'getLSItems')
93 ->willReturn([$ls_item])
97 $result = $obj->getLearnerItems(100, 44);
99 $this->assertIsArray($result);
100 $this->assertEmpty($result);
Get LearningProgress and availability of items in sequence.
◆ testGetLearnerItemsWithoutData()
ilLearnerProgressDBTest::testGetLearnerItemsWithoutData |
( |
| ) |
|
Definition at line 51 of file ilLearnerProgressDBTest.php.
References ILIAS\Repository\access().
54 ->expects($this->once())
55 ->method(
'getLsItems')
61 $result = $obj->getLearnerItems(100, 33);
63 $this->assertIsArray($result);
64 $this->assertEmpty($result);
Get LearningProgress and availability of items in sequence.
◆ testGetLearnerItemsWithVisibleLSItem()
ilLearnerProgressDBTest::testGetLearnerItemsWithVisibleLSItem |
( |
| ) |
|
Definition at line 103 of file ilLearnerProgressDBTest.php.
References $ref_id, and ILIAS\Repository\access().
105 $ls_item = $this->createMock(LSItem::class);
108 ->expects($this->exactly(2))
113 ->expects($this->exactly(3))
119 ->expects($this->once())
124 [100,
'visible',
'', 33],
125 [100,
'read',
'', 33]
128 ->expects($this->exactly(2))
129 ->method(
'checkAccessOfUser')
130 ->willReturnCallback(
131 function ($uid, $perm, $cmd,
$ref_id) use (&$consecutive) {
132 $expected = array_shift($consecutive);
133 $this->assertEquals($expected, [$uid, $perm, $cmd,
$ref_id]);
140 ->expects($this->once())
141 ->method(
'getLSItems')
143 ->willReturn([$ls_item])
147 $result = $obj->getLearnerItems(100, 44);
149 foreach ($result as $ls_learner_item) {
150 $this->assertInstanceOf(LSLearnerItem::class, $ls_learner_item);
151 $this->assertEquals(33, $ls_learner_item->getRefId());
152 $this->assertEquals(20, $ls_learner_item->getLearningProgressStatus());
153 $this->assertEquals(1, $ls_learner_item->getAvailability());
◆ $access
ilAccess ilLearnerProgressDBTest::$access |
|
protected |
◆ $items_db
◆ $obj_data_cache
The documentation for this class was generated from the following file: