summaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption/ManagerTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Encryption/ManagerTest.php
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-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.php15
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());