ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilNullPluginStateDBTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20use ILIAS\Data;
21
22class ilNullPluginStateDBTest extends TestCase
23{
25 protected Data\Factory $data_factory;
26
27 protected function setUp(): void
28 {
29 $this->db = new \ilNullPluginStateDB();
30 $this->data_factory = new Data\Factory();
31 }
32
33 public function testIsPluginActivated(): void
34 {
35 $this->assertFalse($this->db->isPluginActivated("plg1"));
36 $this->assertFalse($this->db->isPluginActivated("plg2"));
37 $this->assertFalse($this->db->isPluginActivated("plg3"));
38 }
39
40 public function testGetCurrentPluginVersion(): void
41 {
42 $this->assertEquals(null, $this->db->getCurrentPluginVersion("plg1"));
43 $this->assertEquals(null, $this->db->getCurrentPluginVersion("plg2"));
44 $this->assertEquals(null, $this->db->getCurrentPluginVersion("plg3"));
45 }
46
47 public function testGetCurrentPluginDBVersion(): void
48 {
49 $this->assertEquals(null, $this->db->getCurrentPluginDBVersion("plg1"));
50 $this->assertEquals(null, $this->db->getCurrentPluginDBVersion("plg2"));
51 $this->assertEquals(null, $this->db->getCurrentPluginVersion("plg3"));
52 }
53
55 {
56 $PLUGIN_ID = "plg2";
57 $VERSION = $this->data_factory->version("1.0.0");
58 $DB_VERSION = 23;
59
60 $this->db->setCurrentPluginVersion($PLUGIN_ID, $VERSION, $DB_VERSION);
61
62 $this->assertTrue(true); // Should simply work...
63 }
64
65 public function testSetActivation(): void
66 {
67 $this->db->setActivation("SOME_ID", true);
68
69 $this->assertTrue(true); // Should simply work...
70 }
71
72
73 public function testRemove(): void
74 {
75 $PLUGIN_ID = "plg1";
76 $this->db->remove($PLUGIN_ID);
77
78 $this->assertTrue(true); // Should simply work...
79 }
80}
Repository interface for plugin state data.