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 --- apps/dav/tests/unit/Command/MoveCalendarTest.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'apps/dav/tests/unit/Command/MoveCalendarTest.php') diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index 50c1a57e0a8..c097427b239 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -89,12 +89,13 @@ class MoveCalendarTest extends TestCase { /** * @dataProvider dataExecute * - * @expectedException InvalidArgumentException * @param $userOriginExists * @param $userDestinationExists */ public function testWithBadUserOrigin($userOriginExists, $userDestinationExists) { + $this->expectException(\InvalidArgumentException::class); + $this->userManager->expects($this->at(0)) ->method('userExists') ->with('user') @@ -115,12 +116,12 @@ class MoveCalendarTest extends TestCase { ]); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage User has no calendar named . You can run occ dav:list-calendars to list calendars URIs for this user. - */ + public function testMoveWithInexistantCalendar() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('User has no calendar named . You can run occ dav:list-calendars to list calendars URIs for this user.'); + $this->userManager->expects($this->at(0)) ->method('userExists') ->with('user') @@ -143,12 +144,12 @@ class MoveCalendarTest extends TestCase { ]); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage User already has a calendar named . - */ + public function testMoveWithExistingDestinationCalendar() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('User already has a calendar named .'); + $this->userManager->expects($this->at(0)) ->method('userExists') ->with('user') -- cgit v1.2.3