◆ setUp()
| ilPluginStateDBOverIlDBInterfaceTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 44 of file ilPluginStateDBOverIlDBInterfaceTest.php.
46 $this->il_db = $this->createMock(\ilDBInterface::class);
47 $this->data_factory =
new Data\Factory();
48 $this->db = new \ilPluginStateDBOverIlDBInterface(
◆ testGetCurrentPluginDBVersion()
| ilPluginStateDBOverIlDBInterfaceTest::testGetCurrentPluginDBVersion |
( |
| ) |
|
Definition at line 90 of file ilPluginStateDBOverIlDBInterfaceTest.php.
92 $handle = $this->createMock(\ilDBStatement::class);
94 $this->il_db->expects($this->once())
96 ->with(
"SELECT * FROM il_plugin")
97 ->willReturn($handle);
98 $this->il_db->expects($this->once())
101 ->willReturn(self::$plugin_data);
103 $this->assertEquals(12, $this->db->getCurrentPluginDBVersion(
"plg1"));
104 $this->assertEquals(0, $this->db->getCurrentPluginDBVersion(
"plg2"));
105 $this->assertEquals(null, $this->db->getCurrentPluginVersion(
"plg3"));
◆ testGetCurrentPluginVersion()
| ilPluginStateDBOverIlDBInterfaceTest::testGetCurrentPluginVersion |
( |
| ) |
|
Definition at line 72 of file ilPluginStateDBOverIlDBInterfaceTest.php.
74 $handle = $this->createMock(\ilDBStatement::class);
76 $this->il_db->expects($this->once())
78 ->with(
"SELECT * FROM il_plugin")
79 ->willReturn($handle);
80 $this->il_db->expects($this->once())
83 ->willReturn(self::$plugin_data);
85 $this->assertEquals($this->data_factory->version(
"1.0.1"), $this->db->getCurrentPluginVersion(
"plg1"));
86 $this->assertEquals($this->data_factory->version(
"2.3.4"), $this->db->getCurrentPluginVersion(
"plg2"));
87 $this->assertEquals(null, $this->db->getCurrentPluginVersion(
"plg3"));
◆ testIsPluginActivated()
| ilPluginStateDBOverIlDBInterfaceTest::testIsPluginActivated |
( |
| ) |
|
Definition at line 54 of file ilPluginStateDBOverIlDBInterfaceTest.php.
56 $handle = $this->createMock(\ilDBStatement::class);
58 $this->il_db->expects($this->once())
60 ->with(
"SELECT * FROM il_plugin")
61 ->willReturn($handle);
62 $this->il_db->expects($this->once())
65 ->willReturn(self::$plugin_data);
67 $this->assertTrue($this->db->isPluginActivated(
"plg1"));
68 $this->assertFalse($this->db->isPluginActivated(
"plg2"));
69 $this->assertFalse($this->db->isPluginActivated(
"plg3"));
◆ testRemove()
| ilPluginStateDBOverIlDBInterfaceTest::testRemove |
( |
| ) |
|
Definition at line 240 of file ilPluginStateDBOverIlDBInterfaceTest.php.
244 $this->il_db->expects($this->once())
246 ->with($PLUGIN_ID,
"text")
247 ->willReturn(
"PLUGIN_ID");
248 $this->il_db->expects($this->once())
249 ->method(
"manipulate")
250 ->with(
"DELETE FROM il_plugin WHERE plugin_id = PLUGIN_ID");
252 $this->db->remove($PLUGIN_ID);
◆ testSetActivationFalse()
| ilPluginStateDBOverIlDBInterfaceTest::testSetActivationFalse |
( |
| ) |
|
Definition at line 209 of file ilPluginStateDBOverIlDBInterfaceTest.php.
211 $handle = $this->createMock(\ilDBStatement::class);
213 $this->il_db->expects($this->once())
215 ->with(
"SELECT * FROM il_plugin")
216 ->willReturn($handle);
217 $this->il_db->expects($this->once())
220 ->willReturn(self::$plugin_data);
224 $this->il_db->expects($this->once())
229 "active" => [
"integer", 0],
232 "plugin_id" => [
"text", $PLUGIN_ID],
236 $this->db->setActivation($PLUGIN_ID,
false);
◆ testSetActivationNotExistingPlugin()
| ilPluginStateDBOverIlDBInterfaceTest::testSetActivationNotExistingPlugin |
( |
| ) |
|
◆ testSetActivationTrue()
| ilPluginStateDBOverIlDBInterfaceTest::testSetActivationTrue |
( |
| ) |
|
Definition at line 179 of file ilPluginStateDBOverIlDBInterfaceTest.php.
181 $handle = $this->createMock(\ilDBStatement::class);
183 $this->il_db->expects($this->once())
185 ->with(
"SELECT * FROM il_plugin")
186 ->willReturn($handle);
187 $this->il_db->expects($this->once())
190 ->willReturn(self::$plugin_data);
194 $this->il_db->expects($this->once())
199 "active" => [
"integer", 1],
202 "plugin_id" => [
"text", $PLUGIN_ID],
206 $this->db->setActivation($PLUGIN_ID,
true);
◆ testSetCurrentPluginVersionKnownPlugin()
| ilPluginStateDBOverIlDBInterfaceTest::testSetCurrentPluginVersionKnownPlugin |
( |
| ) |
|
Definition at line 108 of file ilPluginStateDBOverIlDBInterfaceTest.php.
110 $handle = $this->createMock(\ilDBStatement::class);
112 $this->il_db->expects($this->once())
114 ->with(
"SELECT * FROM il_plugin")
115 ->willReturn($handle);
116 $this->il_db->expects($this->once())
119 ->willReturn(self::$plugin_data);
122 $VERSION = $this->data_factory->version(
"1.0.0");
125 $this->il_db->expects($this->once())
130 "last_update_version" => [
"text", (
string) $VERSION],
131 "db_version" => [
"integer", $DB_VERSION]
134 "plugin_id" => [
"text", $PLUGIN_ID]
138 $this->db->setCurrentPluginVersion($PLUGIN_ID, $VERSION, $DB_VERSION);
◆ testSetCurrentPluginVersionUnknownPlugin()
| ilPluginStateDBOverIlDBInterfaceTest::testSetCurrentPluginVersionUnknownPlugin |
( |
| ) |
|
Definition at line 141 of file ilPluginStateDBOverIlDBInterfaceTest.php.
143 $handle = $this->createMock(\ilDBStatement::class);
145 $this->il_db->expects($this->once())
147 ->with(
"SELECT * FROM il_plugin")
148 ->willReturn($handle);
149 $this->il_db->expects($this->once())
152 ->willReturn(self::$plugin_data);
155 $VERSION = $this->data_factory->version(
"1.0.0");
158 $this->il_db->expects($this->once())
163 "plugin_id" => [
"text", $PLUGIN_ID],
164 "active" => [
"integer", 0],
165 "last_update_version" => [
"text", (
string) $VERSION],
166 "db_version" => [
"integer", $DB_VERSION]
170 $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 29 of file ilPluginStateDBOverIlDBInterfaceTest.php.
The documentation for this class was generated from the following file: