From e688c1dc317d00110ceac2a6fab3c0760706590f Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Mon, 27 Nov 2023 17:10:03 +0100 Subject: [PATCH] fixup! enh(userstatus): add OOO automation and remove calendar automation --- .../lib/User/AvailabilityCoordinatorTest.php | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/tests/lib/User/AvailabilityCoordinatorTest.php b/tests/lib/User/AvailabilityCoordinatorTest.php index 95f34a4ac7f70..b41b1fbac2a8b 100644 --- a/tests/lib/User/AvailabilityCoordinatorTest.php +++ b/tests/lib/User/AvailabilityCoordinatorTest.php @@ -107,9 +107,6 @@ public function testGetOutOfOfficeDataInEffect(): void { ->method('set') ->withConsecutive([$user->getUID() . '_timezone', 'Europe/Berlin', 3600], [$user->getUID(), '{"id":"420","startDate":1696111200,"endDate":1696802340,"shortMessage":"Vacation","message":"On vacation"}', 300]); - $this->absenceService->expects(self::once()) - ->method('isInEffect') - ->willReturn(true); $expected = new OutOfOfficeData( '420', @@ -123,39 +120,6 @@ public function testGetOutOfOfficeDataInEffect(): void { self::assertEquals($expected, $actual); } - public function testGetOutOfOfficeDataNotInEffect(): void { - $absence = new Absence(); - $absence->setId(420); - $absence->setUserId('user'); - $absence->setFirstDay('2023-10-01'); - $absence->setLastDay('2023-10-08'); - $absence->setStatus('Vacation'); - $absence->setMessage('On vacation'); - - $user = $this->createMock(IUser::class); - $user->method('getUID') - ->willReturn('user'); - - $this->cache->expects(self::exactly(2)) - ->method('get') - ->willReturnOnConsecutiveCalls(null, null); - $this->timezoneService->expects(self::once()) - ->method('getUserTimezone') - ->willReturn('Europe/Berlin'); - $this->absenceService->expects(self::once()) - ->method('getAbsence') - ->with($user->getUID()) - ->willReturn($absence); - $this->cache->expects(self::exactly(2)) - ->method('set'); - $this->absenceService->expects(self::once()) - ->method('isInEffect') - ->willReturn(false); - - $actual = $this->availabilityCoordinator->getCurrentOutOfOfficeData($user); - self::assertNull($actual); - } - public function testGetOutOfOfficeDataCachedAll(): void { $absence = new Absence(); $absence->setId(420); @@ -176,9 +140,6 @@ public function testGetOutOfOfficeDataCachedAll(): void { ->method('getAbsence'); $this->cache->expects(self::exactly(1)) ->method('set'); - $this->absenceService->expects(self::once()) - ->method('isInEffect') - ->willReturn(true); $expected = new OutOfOfficeData( '420', @@ -213,8 +174,6 @@ public function testGetOutOfOfficeDataNoData(): void { ->willReturn(null); $this->cache->expects(self::never()) ->method('set'); - $this->absenceService->expects(self::never()) - ->method('isInEffect'); $actual = $this->availabilityCoordinator->getCurrentOutOfOfficeData($user); self::assertNull($actual); @@ -244,9 +203,6 @@ public function testGetOutOfOfficeDataWithInvalidCachedData(): void { $this->cache->expects(self::once()) ->method('set') ->with('user', '{"id":"420","startDate":1696118400,"endDate":1696809540,"shortMessage":"Vacation","message":"On vacation"}', 300); - $this->absenceService->expects(self::once()) - ->method('isInEffect') - ->willReturn(true); $expected = new OutOfOfficeData( '420',