diff options
Diffstat (limited to 'tests/lib/Encryption/ManagerTest.php')
-rw-r--r-- | tests/lib/Encryption/ManagerTest.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index 0919bda36b0..6e18cd296a3 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -35,7 +35,7 @@ class ManagerTest extends TestCase { /** @var ArrayCache|\PHPUnit_Framework_MockObject_MockObject */ private $arrayCache; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); $this->logger = $this->createMock(ILogger::class); @@ -81,10 +81,11 @@ class ManagerTest extends TestCase { /** * @depends testModuleRegistration - * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException - * @expectedExceptionMessage Id "ID0" already used by encryption module "TestDummyModule0" */ public function testModuleReRegistration($manager) { + $this->expectException(\OC\Encryption\Exceptions\ModuleAlreadyExistsException::class); + $this->expectExceptionMessage('Id "ID0" already used by encryption module "TestDummyModule0"'); + $this->addNewEncryptionModule($manager, 0); } @@ -98,11 +99,11 @@ class ManagerTest extends TestCase { } - /** - * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException - * @expectedExceptionMessage Module with ID: unknown does not exist. - */ + public function testGetEncryptionModuleUnknown() { + $this->expectException(\OC\Encryption\Exceptions\ModuleDoesNotExistsException::class); + $this->expectExceptionMessage('Module with ID: unknown does not exist.'); + $this->config->expects($this->any())->method('getAppValue')->willReturn(true); $this->addNewEncryptionModule($this->manager, 0); $this->assertCount(1, $this->manager->getEncryptionModules()); |