diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
commit | 3a7cf40aaa678bea1df143d2982d603b7a334eec (patch) | |
tree | 63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Encryption/ManagerTest.php | |
parent | 0568b012672d650c6b5a49e72c4028dde5463c60 (diff) | |
download | nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip |
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
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()); |