Пример #1
0
 public function testModuleUnRegistration()
 {
     $this->config->expects($this->any())->method('getAppValue')->willReturn(true);
     $this->addNewEncryptionModule($this->manager, 0);
     $this->assertCount(1, $this->manager->getEncryptionModules());
     $this->manager->unregisterEncryptionModule('ID0');
     $this->assertEmpty($this->manager->getEncryptionModules());
 }
Пример #2
0
 public function testModuleUnRegistration()
 {
     $config = $this->getMock('\\OCP\\IConfig');
     $config->expects($this->any())->method('getAppValue')->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->assertSame(1, count($m->getEncryptionModules()));
     $m->unregisterEncryptionModule($em);
     $this->assertEmpty($m->getEncryptionModules());
 }