◆ setUp()
ilLearningSequenceActivationDBTest::setUp |
( |
| ) |
|
|
protected |
◆ testCreateObjectMinimal()
ilLearningSequenceActivationDBTest::testCreateObjectMinimal |
( |
| ) |
|
◆ testDeleteForRefId()
ilLearningSequenceActivationDBTest::testDeleteForRefId |
( |
| ) |
|
Definition at line 148 of file ilLearningSequenceActivationDBTest.php.
151 'DELETE FROM lso_activation' . PHP_EOL
152 .
'WHERE ref_id = 44' . PHP_EOL
156 ->expects($this->once())
158 ->with(44,
'integer')
162 ->expects($this->once())
163 ->method(
'manipulate')
168 $obj->deleteForRefId(44);
Persistence for online/activation period.
◆ testGetActivationForRefIdWithData()
ilLearningSequenceActivationDBTest::testGetActivationForRefIdWithData |
( |
| ) |
|
Definition at line 93 of file ilLearningSequenceActivationDBTest.php.
95 $start_date =
new DateTime(
'2021-07-21 08:19');
96 $end_date =
new DateTime(
'2021-07-21 08:20');
99 'SELECT ref_id, online, effective_online, activation_start_ts, activation_end_ts' . PHP_EOL
100 .
'FROM lso_activation' . PHP_EOL
101 .
'WHERE ref_id = 33' . PHP_EOL
107 "effective_online" =>
true,
108 "activation_start_ts" => $start_date->getTimestamp(),
109 "activation_end_ts" => $end_date->getTimestamp()
113 ->expects($this->once())
115 ->with(33,
'integer')
118 $return_statement = $this->getMockBuilder(ilDBStatement::class)->getMock();
120 ->expects($this->once())
123 ->willReturn($return_statement)
126 ->expects($this->once())
131 ->expects($this->once())
132 ->method(
'fetchAssoc')
133 ->with($return_statement)
134 ->willReturn($values)
138 $settings = $obj->getActivationForRefId(33);
140 $this->assertInstanceOf(ilLearningSequenceActivation::class, $settings);
141 $this->assertEquals(33, $settings->getRefId());
142 $this->assertTrue($settings->getIsOnline());
143 $this->assertTrue($settings->getEffectiveOnlineStatus());
144 $this->assertEquals($start_date, $settings->getActivationStart());
145 $this->assertEquals($end_date, $settings->getActivationEnd());
Persistence for online/activation period.
◆ testGetActivationForRefIdWithoutData()
ilLearningSequenceActivationDBTest::testGetActivationForRefIdWithoutData |
( |
| ) |
|
Definition at line 42 of file ilLearningSequenceActivationDBTest.php.
References null.
45 'SELECT ref_id, online, effective_online, activation_start_ts, activation_end_ts' . PHP_EOL
46 .
'FROM lso_activation' . PHP_EOL
47 .
'WHERE ref_id = 22' . PHP_EOL
51 "ref_id" => [
"integer", 22],
52 "online" => [
"integer",
false],
53 "effective_online" => [
"integer",
false],
54 "activation_start_ts" => [
"integer",
null],
55 "activation_end_ts" => [
"integer",
null]
59 ->expects($this->once())
64 $return = $this->getMockBuilder(ilDBStatement::class)->getMock();
66 ->expects($this->once())
72 ->expects($this->once())
77 ->expects($this->once())
79 ->with(
'lso_activation', $values)
83 $settings = $obj->getActivationForRefId(22);
85 $this->assertInstanceOf(ilLearningSequenceActivation::class, $settings);
86 $this->assertEquals(22, $settings->getRefId());
87 $this->assertFalse($settings->getIsOnline());
88 $this->assertFalse($settings->getEffectiveOnlineStatus());
89 $this->assertNull($settings->getActivationStart());
90 $this->assertNull($settings->getActivationEnd());
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Persistence for online/activation period.
◆ testStore()
ilLearningSequenceActivationDBTest::testStore |
( |
| ) |
|
Definition at line 171 of file ilLearningSequenceActivationDBTest.php.
173 $start_date =
new DateTime(
'2021-07-21 08:19');
174 $end_date =
new DateTime(
'2021-07-21 08:20');
177 $where = [
'ref_id' => [
'integer', 35]];
180 "online" => [
"integer",
true],
181 "activation_start_ts" => [
"integer", $start_date->getTimestamp()],
182 "activation_end_ts" => [
"integer", $end_date->getTimestamp()]
186 ->expects($this->once())
188 ->with(
'lso_activation', $values, $where)
193 $obj->store($settings);
Activation-Settings for an LSO.
Persistence for online/activation period.
◆ $db
ilLearningSequenceActivationDBTest::$db |
|
protected |
The documentation for this class was generated from the following file: