diff options
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php index dcf11a1a6b8..c091f590711 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php @@ -21,20 +21,11 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class NotifierTest extends TestCase { - /** @var Notifier */ - protected $notifier; - - /** @var IFactory|MockObject */ - protected $factory; - - /** @var IURLGenerator|MockObject */ - protected $urlGenerator; - - /** @var IL10N|MockObject */ - protected $l10n; - - /** @var ITimeFactory|MockObject */ - protected $timeFactory; + protected IFactory&MockObject $factory; + protected IURLGenerator&MockObject $urlGenerator; + protected IL10N&MockObject $l10n; + protected ITimeFactory&MockObject $timeFactory; + protected Notifier $notifier; protected function setUp(): void { parent::setUp(); @@ -92,7 +83,7 @@ class NotifierTest extends TestCase { $this->expectException(UnknownNotificationException::class); $this->expectExceptionMessage('Notification not from this app'); - /** @var INotification|MockObject $notification */ + /** @var INotification&MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) @@ -109,7 +100,7 @@ class NotifierTest extends TestCase { $this->expectException(UnknownNotificationException::class); $this->expectExceptionMessage('Unknown subject'); - /** @var INotification|MockObject $notification */ + /** @var INotification&MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) @@ -130,7 +121,7 @@ class NotifierTest extends TestCase { return $d1->diff($d2)->y < 0; } - public function dataPrepare(): array { + public static function dataPrepare(): array { return [ [ 'calendar_reminder', @@ -179,18 +170,9 @@ class NotifierTest extends TestCase { ]; } - /** - * @dataProvider dataPrepare - * - * @param string $subjectType - * @param array $subjectParams - * @param string $subject - * @param array $messageParams - * @param string $message - * @throws \Exception - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataPrepare')] public function testPrepare(string $subjectType, array $subjectParams, string $subject, array $messageParams, string $message): void { - /** @var INotification|MockObject $notification */ + /** @var INotification&MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) @@ -235,7 +217,7 @@ class NotifierTest extends TestCase { } public function testPassedEvent(): void { - /** @var INotification|MockObject $notification */ + /** @var INotification&MockObject $notification */ $notification = $this->createMock(INotification::class); $notification->expects($this->once()) |