◆ setUp()
ilPluginStateDBOverIlDBInterfaceTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 43 of file ilPluginStateDBOverIlDBInterfaceTest.php.
45 $this->il_db = $this->createMock(\ilDBInterface::class);
46 $this->data_factory =
new Data\Factory();
47 $this->db = new \ilPluginStateDBOverIlDBInterface(
◆ testGetCurrentPluginDBVersion()
ilPluginStateDBOverIlDBInterfaceTest::testGetCurrentPluginDBVersion |
( |
| ) |
|
Definition at line 89 of file ilPluginStateDBOverIlDBInterfaceTest.php.
References null.
91 $handle = $this->createMock(\ilDBStatement::class);
93 $this->il_db->expects($this->once())
95 ->with(
"SELECT * FROM il_plugin")
96 ->willReturn($handle);
97 $this->il_db->expects($this->once())
100 ->willReturn(self::$plugin_data);
102 $this->assertEquals(12, $this->db->getCurrentPluginDBVersion(
"plg1"));
103 $this->assertEquals(0, $this->db->getCurrentPluginDBVersion(
"plg2"));
104 $this->assertEquals(
null, $this->db->getCurrentPluginVersion(
"plg3"));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testGetCurrentPluginVersion()
ilPluginStateDBOverIlDBInterfaceTest::testGetCurrentPluginVersion |
( |
| ) |
|
Definition at line 71 of file ilPluginStateDBOverIlDBInterfaceTest.php.
References null.
73 $handle = $this->createMock(\ilDBStatement::class);
75 $this->il_db->expects($this->once())
77 ->with(
"SELECT * FROM il_plugin")
78 ->willReturn($handle);
79 $this->il_db->expects($this->once())
82 ->willReturn(self::$plugin_data);
84 $this->assertEquals($this->data_factory->version(
"1.0.1"), $this->db->getCurrentPluginVersion(
"plg1"));
85 $this->assertEquals($this->data_factory->version(
"2.3.4"), $this->db->getCurrentPluginVersion(
"plg2"));
86 $this->assertEquals(
null, $this->db->getCurrentPluginVersion(
"plg3"));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testIsPluginActivated()
ilPluginStateDBOverIlDBInterfaceTest::testIsPluginActivated |
( |
| ) |
|
Definition at line 53 of file ilPluginStateDBOverIlDBInterfaceTest.php.
55 $handle = $this->createMock(\ilDBStatement::class);
57 $this->il_db->expects($this->once())
59 ->with(
"SELECT * FROM il_plugin")
60 ->willReturn($handle);
61 $this->il_db->expects($this->once())
64 ->willReturn(self::$plugin_data);
66 $this->assertTrue($this->db->isPluginActivated(
"plg1"));
67 $this->assertFalse($this->db->isPluginActivated(
"plg2"));
68 $this->assertFalse($this->db->isPluginActivated(
"plg3"));
◆ testRemove()
ilPluginStateDBOverIlDBInterfaceTest::testRemove |
( |
| ) |
|
Definition at line 239 of file ilPluginStateDBOverIlDBInterfaceTest.php.
243 $this->il_db->expects($this->once())
245 ->with($PLUGIN_ID,
"text")
246 ->willReturn(
"PLUGIN_ID");
247 $this->il_db->expects($this->once())
248 ->method(
"manipulate")
249 ->with(
"DELETE FROM il_plugin WHERE plugin_id = PLUGIN_ID");
251 $this->db->remove($PLUGIN_ID);
◆ testSetActivationFalse()
ilPluginStateDBOverIlDBInterfaceTest::testSetActivationFalse |
( |
| ) |
|
Definition at line 208 of file ilPluginStateDBOverIlDBInterfaceTest.php.
210 $handle = $this->createMock(\ilDBStatement::class);
212 $this->il_db->expects($this->once())
214 ->with(
"SELECT * FROM il_plugin")
215 ->willReturn($handle);
216 $this->il_db->expects($this->once())
219 ->willReturn(self::$plugin_data);
223 $this->il_db->expects($this->once())
228 "active" => [
"integer", 0],
231 "plugin_id" => [
"text", $PLUGIN_ID],
235 $this->db->setActivation($PLUGIN_ID,
false);
◆ testSetActivationNotExistingPlugin()
ilPluginStateDBOverIlDBInterfaceTest::testSetActivationNotExistingPlugin |
( |
| ) |
|
◆ testSetActivationTrue()
ilPluginStateDBOverIlDBInterfaceTest::testSetActivationTrue |
( |
| ) |
|
Definition at line 178 of file ilPluginStateDBOverIlDBInterfaceTest.php.
180 $handle = $this->createMock(\ilDBStatement::class);
182 $this->il_db->expects($this->once())
184 ->with(
"SELECT * FROM il_plugin")
185 ->willReturn($handle);
186 $this->il_db->expects($this->once())
189 ->willReturn(self::$plugin_data);
193 $this->il_db->expects($this->once())
198 "active" => [
"integer", 1],
201 "plugin_id" => [
"text", $PLUGIN_ID],
205 $this->db->setActivation($PLUGIN_ID,
true);
◆ testSetCurrentPluginVersionKnownPlugin()
ilPluginStateDBOverIlDBInterfaceTest::testSetCurrentPluginVersionKnownPlugin |
( |
| ) |
|
Definition at line 107 of file ilPluginStateDBOverIlDBInterfaceTest.php.
109 $handle = $this->createMock(\ilDBStatement::class);
111 $this->il_db->expects($this->once())
113 ->with(
"SELECT * FROM il_plugin")
114 ->willReturn($handle);
115 $this->il_db->expects($this->once())
118 ->willReturn(self::$plugin_data);
121 $VERSION = $this->data_factory->version(
"1.0.0");
124 $this->il_db->expects($this->once())
129 "last_update_version" => [
"text", (
string) $VERSION],
130 "db_version" => [
"integer", $DB_VERSION]
133 "plugin_id" => [
"text", $PLUGIN_ID]
137 $this->db->setCurrentPluginVersion($PLUGIN_ID, $VERSION, $DB_VERSION);
◆ testSetCurrentPluginVersionUnknownPlugin()
ilPluginStateDBOverIlDBInterfaceTest::testSetCurrentPluginVersionUnknownPlugin |
( |
| ) |
|
Definition at line 140 of file ilPluginStateDBOverIlDBInterfaceTest.php.
142 $handle = $this->createMock(\ilDBStatement::class);
144 $this->il_db->expects($this->once())
146 ->with(
"SELECT * FROM il_plugin")
147 ->willReturn($handle);
148 $this->il_db->expects($this->once())
151 ->willReturn(self::$plugin_data);
154 $VERSION = $this->data_factory->version(
"1.0.0");
157 $this->il_db->expects($this->once())
162 "plugin_id" => [
"text", $PLUGIN_ID],
163 "active" => [
"integer", 0],
164 "last_update_version" => [
"text", (
string) $VERSION],
165 "db_version" => [
"integer", $DB_VERSION]
169 $this->db->setCurrentPluginVersion($PLUGIN_ID, $VERSION, $DB_VERSION);
◆ $data_factory
Data Factory ilPluginStateDBOverIlDBInterfaceTest::$data_factory |
|
protected |
◆ $db
◆ $il_db
◆ $plugin_data
array ilPluginStateDBOverIlDBInterfaceTest::$plugin_data |
|
static |
◆ last_update_version
array ilPluginStateDBOverIlDBInterfaceTest::last_update_version |
|
static |
Initial value:=> "1.0.1",
"db_version" => 12
],
[
"plugin_id" => "plg2",
"active" => false,
"last_update_version" => "2.3.4",
"db_version" => 0
]
]
Definition at line 28 of file ilPluginStateDBOverIlDBInterfaceTest.php.
The documentation for this class was generated from the following file: