aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Service/AbsenceServiceTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/Service/AbsenceServiceTest.php')
-rw-r--r--apps/dav/tests/unit/Service/AbsenceServiceTest.php39
1 files changed, 15 insertions, 24 deletions
diff --git a/apps/dav/tests/unit/Service/AbsenceServiceTest.php b/apps/dav/tests/unit/Service/AbsenceServiceTest.php
index 1bc5f53f18c..c16c715d5c2 100644
--- a/apps/dav/tests/unit/Service/AbsenceServiceTest.php
+++ b/apps/dav/tests/unit/Service/AbsenceServiceTest.php
@@ -7,7 +7,7 @@ declare(strict_types=1);
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-namespace OCA\dav\tests\unit\Service;
+namespace OCA\DAV\Tests\unit\Service;
use DateTimeImmutable;
use DateTimeZone;
@@ -24,25 +24,16 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IUser;
use OCP\User\Events\OutOfOfficeChangedEvent;
use OCP\User\Events\OutOfOfficeScheduledEvent;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
class AbsenceServiceTest extends TestCase {
private AbsenceService $absenceService;
-
- /** @var MockObject|AbsenceMapper */
- private $absenceMapper;
-
- /** @var MockObject|IEventDispatcher */
- private $eventDispatcher;
-
- /** @var MockObject|IJobList */
- private $jobList;
-
- /** @var MockObject|TimezoneService */
- private $timezoneService;
-
- /** @var MockObject|ITimeFactory */
- private $timeFactory;
+ private AbsenceMapper&MockObject $absenceMapper;
+ private IEventDispatcher&MockObject $eventDispatcher;
+ private IJobList&MockObject $jobList;
+ private TimezoneService&MockObject $timezoneService;
+ private ITimeFactory&MockObject $timeFactory;
protected function setUp(): void {
parent::setUp();
@@ -62,7 +53,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testCreateAbsenceEmitsScheduledEvent() {
+ public function testCreateAbsenceEmitsScheduledEvent(): void {
$tz = new DateTimeZone('Europe/Berlin');
$user = $this->createMock(IUser::class);
$user->method('getUID')
@@ -117,7 +108,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testUpdateAbsenceEmitsChangedEvent() {
+ public function testUpdateAbsenceEmitsChangedEvent(): void {
$tz = new DateTimeZone('Europe/Berlin');
$user = $this->createMock(IUser::class);
$user->method('getUID')
@@ -181,7 +172,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testCreateAbsenceSchedulesBothJobs() {
+ public function testCreateAbsenceSchedulesBothJobs(): void {
$tz = new DateTimeZone('Europe/Berlin');
$startDateString = '2023-01-05';
$startDate = new DateTimeImmutable($startDateString, $tz);
@@ -230,7 +221,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testCreateAbsenceSchedulesOnlyEndJob() {
+ public function testCreateAbsenceSchedulesOnlyEndJob(): void {
$tz = new DateTimeZone('Europe/Berlin');
$endDateString = '2023-01-10';
$endDate = new DateTimeImmutable($endDateString, $tz);
@@ -271,7 +262,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testCreateAbsenceSchedulesNoJob() {
+ public function testCreateAbsenceSchedulesNoJob(): void {
$tz = new DateTimeZone('Europe/Berlin');
$user = $this->createMock(IUser::class);
$user->method('getUID')
@@ -306,7 +297,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testUpdateAbsenceSchedulesBothJobs() {
+ public function testUpdateAbsenceSchedulesBothJobs(): void {
$tz = new DateTimeZone('Europe/Berlin');
$startDateString = '2023-01-05';
$startDate = new DateTimeImmutable($startDateString, $tz);
@@ -362,7 +353,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testUpdateSchedulesOnlyEndJob() {
+ public function testUpdateSchedulesOnlyEndJob(): void {
$tz = new DateTimeZone('Europe/Berlin');
$endDateString = '2023-01-10';
$endDate = new DateTimeImmutable($endDateString, $tz);
@@ -410,7 +401,7 @@ class AbsenceServiceTest extends TestCase {
);
}
- public function testUpdateAbsenceSchedulesNoJob() {
+ public function testUpdateAbsenceSchedulesNoJob(): void {
$tz = new DateTimeZone('Europe/Berlin');
$user = $this->createMock(IUser::class);
$user->method('getUID')