From 3a7cf40aaa678bea1df143d2982d603b7a334eec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 27 Nov 2019 15:27:18 +0100 Subject: Mode to modern phpunit Signed-off-by: Roeland Jago Douma --- .../tests/Unit/BackgroundJob/CheckBackupCodeTest.php | 2 +- .../tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php | 2 +- .../tests/Unit/Notification/NotifierTest.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apps/twofactor_backupcodes/tests') diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php index 2e68c0e427b..3e14cbfa3a1 100644 --- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php @@ -55,7 +55,7 @@ class CheckBackupCodeTest extends TestCase { /** @var CheckBackupCodes */ private $checkBackupCodes; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php index a6dda9ce6aa..0410facb4f7 100644 --- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php @@ -54,7 +54,7 @@ class RememberBackupCodesJobTest extends TestCase { /** @var RememberBackupCodesJob */ private $job; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->registry = $this->createMock(IRegistry::class); diff --git a/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php b/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php index 0bbdc8619b4..73754cecb95 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php @@ -64,10 +64,10 @@ class NotifierTest extends TestCase { ); } - /** - * @expectedException \InvalidArgumentException - */ + public function testPrepareWrongApp() { + $this->expectException(\InvalidArgumentException::class); + /** @var INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) @@ -79,10 +79,10 @@ class NotifierTest extends TestCase { $this->notifier->prepare($notification, 'en'); } - /** - * @expectedException \InvalidArgumentException - */ + public function testPrepareWrongSubject() { + $this->expectException(\InvalidArgumentException::class); + /** @var INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) -- cgit v1.2.3