summaryrefslogtreecommitdiff
path: root/tests/units/Core/Plugin/LoaderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Core/Plugin/LoaderTest.php')
-rw-r--r--tests/units/Core/Plugin/LoaderTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/units/Core/Plugin/LoaderTest.php b/tests/units/Core/Plugin/LoaderTest.php
new file mode 100644
index 00000000..40c23fbb
--- /dev/null
+++ b/tests/units/Core/Plugin/LoaderTest.php
@@ -0,0 +1,23 @@
+<?php
+
+require_once __DIR__.'/../../Base.php';
+
+use Core\Plugin\Loader;
+
+class LoaderTest extends Base
+{
+ public function testGetSchemaVersion()
+ {
+ $p = new Loader($this->container);
+ $this->assertEquals(0, $p->getSchemaVersion('not_found'));
+
+ $this->assertTrue($p->setSchemaVersion('plugin1', 1));
+ $this->assertEquals(1, $p->getSchemaVersion('plugin1'));
+
+ $this->assertTrue($p->setSchemaVersion('plugin2', 33));
+ $this->assertEquals(33, $p->getSchemaVersion('plugin2'));
+
+ $this->assertTrue($p->setSchemaVersion('plugin1', 2));
+ $this->assertEquals(2, $p->getSchemaVersion('plugin1'));
+ }
+}