AbstractNotificationProviderTest.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\Tests\unit\CalDAV\Reminder\NotificationProvider;
  8. use OCA\DAV\CalDAV\Reminder\NotificationProvider\AbstractProvider;
  9. use OCP\IConfig;
  10. use OCP\IL10N;
  11. use OCP\IURLGenerator;
  12. use OCP\IUser;
  13. use OCP\L10N\IFactory as L10NFactory;
  14. use Psr\Log\LoggerInterface;
  15. use Sabre\VObject\Component\VCalendar;
  16. use Test\TestCase;
  17. abstract class AbstractNotificationProviderTest extends TestCase {
  18. /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
  19. protected $logger;
  20. /** @var L10NFactory|\PHPUnit\Framework\MockObject\MockObject */
  21. protected $l10nFactory;
  22. /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
  23. protected $l10n;
  24. /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
  25. protected $urlGenerator;
  26. /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
  27. protected $config;
  28. /** @var AbstractProvider|\PHPUnit\Framework\MockObject\MockObject */
  29. protected $provider;
  30. /**
  31. * @var VCalendar
  32. */
  33. protected $vcalendar;
  34. /**
  35. * @var string
  36. */
  37. protected $calendarDisplayName;
  38. /**
  39. * @var IUser|\PHPUnit\Framework\MockObject\MockObject
  40. */
  41. protected $user;
  42. protected function setUp(): void {
  43. parent::setUp();
  44. $this->logger = $this->createMock(LoggerInterface::class);
  45. $this->l10nFactory = $this->createMock(L10NFactory::class);
  46. $this->l10n = $this->createMock(IL10N::class);
  47. $this->urlGenerator = $this->createMock(IURLGenerator::class);
  48. $this->config = $this->createMock(IConfig::class);
  49. $this->vcalendar = new VCalendar();
  50. $this->vcalendar->add('VEVENT', [
  51. 'SUMMARY' => 'Fellowship meeting',
  52. 'DTSTART' => new \DateTime('2017-01-01 00:00:00+00:00'), // 1483228800,
  53. 'UID' => 'uid1234',
  54. ]);
  55. $this->calendarDisplayName = 'Personal';
  56. $this->user = $this->createMock(IUser::class);
  57. }
  58. }