diff options
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php index b090fa0e5e7..5034af49cae 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php @@ -13,13 +13,11 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\IUser; use OCP\Notification\IManager; use OCP\Notification\INotification; +use PHPUnit\Framework\MockObject\MockObject; -class PushProviderTest extends AbstractNotificationProviderTest { - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - private $manager; - - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; +class PushProviderTest extends AbstractNotificationProviderTestCase { + private IManager&MockObject $manager; + private ITimeFactory&MockObject $timeFactory; protected function setUp(): void { parent::setUp(); @@ -96,20 +94,23 @@ class PushProviderTest extends AbstractNotificationProviderTest { $this->manager->expects($this->exactly(3)) ->method('createNotification') - ->with() ->willReturnOnConsecutiveCalls( $notification1, $notification2, $notification3 ); + $calls = [ + $notification1, + $notification2, + $notification3, + ]; $this->manager->expects($this->exactly(3)) ->method('notify') - ->withConsecutive( - [$notification1], - [$notification2], - [$notification3], - ); + ->willReturnCallback(function ($notification) use (&$calls): void { + $expected = array_shift($calls); + $this->assertEquals($expected, $notification); + }); $this->provider->send($this->vcalendar->VEVENT, $this->calendarDisplayName, [], $users); } |