diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php index 0e6e76d3927b8..2978863da8801 100644 --- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php +++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php @@ -82,7 +82,7 @@ public function testInitialize() { $plugin = new EnablePlugin($this->config, $this->birthdayService); - $server->expects($this->at(0)) + $server->expects($this->once()) ->method('on') ->with('method:POST', [$plugin, 'httpPost']); @@ -120,11 +120,11 @@ public function testHttpPostWrongRequest() { ->with('/bar/foo') ->willReturn($calendarHome); - $this->request->expects($this->at(0)) + $this->request->expects($this->once()) ->method('getBodyAsString') ->willReturn(''); - $this->request->expects($this->at(1)) + $this->request->expects($this->once()) ->method('getUrl') ->willReturn('url_abc'); @@ -158,11 +158,11 @@ public function testHttpPost() { ->method('getOwner') ->willReturn('principals/users/BlaBlub'); - $this->request->expects($this->at(0)) + $this->request->expects($this->once()) ->method('getBodyAsString') ->willReturn(''); - $this->request->expects($this->at(1)) + $this->request->expects($this->once()) ->method('getUrl') ->willReturn('url_abc'); diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index d1fc2c32f28df..f017664238c16 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -96,15 +96,13 @@ public function testEnable() { $closure($user3); }); - $this->jobList->expects($this->at(0)) + $this->jobList->expects($this->exactly(3)) ->method('add') - ->with(GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid1']); - $this->jobList->expects($this->at(1)) - ->method('add') - ->with(GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid2']); - $this->jobList->expects($this->at(2)) - ->method('add') - ->with(GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid3']); + ->withConsecutive( + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid1']], + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid2']], + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid3']], + ); $response = $this->controller->enable(); $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $response); diff --git a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php index 52c99fad2eee6..639708c57ff1c 100644 --- a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php +++ b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php @@ -62,7 +62,7 @@ public function testGetName() { } public function testRun() { - $this->config->expects($this->at(0)) + $this->config->expects($this->once()) ->method('getAppValue') ->with('dav', 'regeneratedBirthdayCalendarsForYearFix') ->willReturn(null); @@ -72,11 +72,11 @@ public function testRun() { ->method('info') ->with('Adding background jobs to regenerate birthday calendar'); - $this->jobList->expects($this->at(0)) + $this->jobList->expects($this->once()) ->method('add') ->with(RegisterRegenerateBirthdayCalendars::class); - $this->config->expects($this->at(1)) + $this->config->expects($this->once()) ->method('setAppValue') ->with('dav', 'regeneratedBirthdayCalendarsForYearFix', 'yes');