diff options
Diffstat (limited to 'apps/dav/tests/unit/Controller')
-rw-r--r-- | apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php | 10 | ||||
-rw-r--r-- | apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php | 50 |
2 files changed, 30 insertions, 30 deletions
diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index e847e3a036e..bfb789678b7 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -81,18 +81,18 @@ class BirthdayCalendarControllerTest extends TestCase { $this->userManager->expects($this->once()) ->method('callForSeenUsers') - ->will($this->returnCallback(function($closure) { + ->willReturnCallback(function($closure) { $user1 = $this->createMock(IUser::class); - $user1->method('getUID')->will($this->returnValue('uid1')); + $user1->method('getUID')->willReturn('uid1'); $user2 = $this->createMock(IUser::class); - $user2->method('getUID')->will($this->returnValue('uid2')); + $user2->method('getUID')->willReturn('uid2'); $user3 = $this->createMock(IUser::class); - $user3->method('getUID')->will($this->returnValue('uid3')); + $user3->method('getUID')->willReturn('uid3'); $closure($user1); $closure($user2); $closure($user3); - })); + }); $this->jobList->expects($this->at(0)) ->method('add') diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php index 811c4cac283..1c29ca7d80b 100644 --- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php +++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php @@ -108,7 +108,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->will($this->returnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -120,7 +120,7 @@ EOF; $iTipMessage->scheduleStatus = '1.2;Message delivered locally'; $this->assertEquals($expected, $iTipMessage->message->serialize()); - })); + }); @@ -164,7 +164,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->will($this->returnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -176,7 +176,7 @@ EOF; $iTipMessage->scheduleStatus = '1.2;Message delivered locally'; $this->assertEquals($expected, $iTipMessage->message->serialize()); - })); + }); @@ -221,7 +221,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->will($this->returnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -233,7 +233,7 @@ EOF; $iTipMessage->scheduleStatus = '1.2;Message delivered locally'; $this->assertEquals($expected, $iTipMessage->message->serialize()); - })); + }); @@ -304,7 +304,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->will($this->returnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -316,7 +316,7 @@ EOF; $iTipMessage->scheduleStatus = '1.2;Message delivered locally'; $this->assertEquals($expected, $iTipMessage->message->serialize()); - })); + }); @@ -338,15 +338,15 @@ EOF; $this->request->expects($this->at(0)) ->method('getParam') ->with('partStat') - ->will($this->returnValue('TENTATIVE')); + ->willReturn('TENTATIVE'); $this->request->expects($this->at(1)) ->method('getParam') ->with('guests') - ->will($this->returnValue('7')); + ->willReturn('7'); $this->request->expects($this->at(2)) ->method('getParam') ->with('comment') - ->will($this->returnValue('Foo bar Bli blub')); + ->willReturn('Foo bar Bli blub'); $this->buildQueryExpects('TOKEN123', [ 'id' => 0, @@ -382,7 +382,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->will($this->returnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -394,7 +394,7 @@ EOF; $iTipMessage->scheduleStatus = '1.2;Message delivered locally'; $this->assertEquals($expected, $iTipMessage->message->serialize()); - })); + }); @@ -413,47 +413,47 @@ EOF; $this->dbConnection->expects($this->once()) ->method('getQueryBuilder') ->with() - ->will($this->returnValue($queryBuilder)); + ->willReturn($queryBuilder); $queryBuilder->method('expr') - ->will($this->returnValue($expr)); + ->willReturn($expr); $queryBuilder->method('createNamedParameter') - ->will($this->returnValueMap([ + ->willReturnMap([ [$token, \PDO::PARAM_STR, null, 'namedParameterToken'] - ])); + ]); $stmt->expects($this->once()) ->method('fetch') ->with(\PDO::FETCH_ASSOC) - ->will($this->returnValue($return)); + ->willReturn($return); $expr->expects($this->once()) ->method('eq') ->with('token', 'namedParameterToken') - ->will($this->returnValue('EQ STATEMENT')); + ->willReturn('EQ STATEMENT'); $this->dbConnection->expects($this->once()) ->method('getQueryBuilder') ->with() - ->will($this->returnValue($queryBuilder)); + ->willReturn($queryBuilder); $queryBuilder->expects($this->at(0)) ->method('select') ->with('*') - ->will($this->returnValue($queryBuilder)); + ->willReturn($queryBuilder); $queryBuilder->expects($this->at(1)) ->method('from') ->with('calendar_invitations') - ->will($this->returnValue($queryBuilder)); + ->willReturn($queryBuilder); $queryBuilder->expects($this->at(4)) ->method('where') ->with('EQ STATEMENT') - ->will($this->returnValue($queryBuilder)); + ->willReturn($queryBuilder); $queryBuilder->expects($this->at(5)) ->method('execute') ->with() - ->will($this->returnValue($stmt)); + ->willReturn($stmt); $this->timeFactory->method('getTime') - ->will($this->returnValue($time)); + ->willReturn($time); } } |