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