summaryrefslogtreecommitdiffstats
path: root/tests/lib/encryption/managertest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/encryption/managertest.php')
-rw-r--r--tests/lib/encryption/managertest.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/lib/encryption/managertest.php b/tests/lib/encryption/managertest.php
index ab297bae0cb..4fcbc3b9983 100644
--- a/tests/lib/encryption/managertest.php
+++ b/tests/lib/encryption/managertest.php
@@ -111,4 +111,62 @@ class ManagerTest extends TestCase {
$en0 = $m->getEncryptionModule(0);
$this->assertEquals(0, $en0->getId());
}
+
+// /**
+// * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException
+// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0"
+// */
+// public function testModuleRegistration() {
+// $config = $this->getMock('\OCP\IConfig');
+// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
+// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em->expects($this->any())->method('getId')->willReturn(0);
+// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
+// $m = new Manager($config);
+// $m->registerEncryptionModule($em);
+// $this->assertTrue($m->isEnabled());
+// $m->registerEncryptionModule($em);
+// }
+//
+// public function testModuleUnRegistration() {
+// $config = $this->getMock('\OCP\IConfig');
+// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
+// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em->expects($this->any())->method('getId')->willReturn(0);
+// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
+// $m = new Manager($config);
+// $m->registerEncryptionModule($em);
+// $this->assertTrue($m->isEnabled());
+// $m->unregisterEncryptionModule($em);
+// $this->assertFalse($m->isEnabled());
+// }
+//
+// /**
+// * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException
+// * @expectedExceptionMessage Module with id: unknown does not exists.
+// */
+// public function testGetEncryptionModuleUnknown() {
+// $config = $this->getMock('\OCP\IConfig');
+// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
+// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em->expects($this->any())->method('getId')->willReturn(0);
+// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
+// $m = new Manager($config);
+// $m->registerEncryptionModule($em);
+// $this->assertTrue($m->isEnabled());
+// $m->getEncryptionModule('unknown');
+// }
+//
+// public function testGetEncryptionModule() {
+// $config = $this->getMock('\OCP\IConfig');
+// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
+// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em->expects($this->any())->method('getId')->willReturn(0);
+// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
+// $m = new Manager($config);
+// $m->registerEncryptionModule($em);
+// $this->assertTrue($m->isEnabled());
+// $en0 = $m->getEncryptionModule(0);
+// $this->assertEquals(0, $en0->getId());
+// }
}