You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractNotificationProviderTest.php 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019, Thomas Citharel
  5. *
  6. * @author Georg Ehrke <oc.list@georgehrke.com>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Thomas Citharel <nextcloud@tcit.fr>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCA\DAV\Tests\unit\CalDAV\Reminder\NotificationProvider;
  27. use OCA\DAV\CalDAV\Reminder\NotificationProvider\AbstractProvider;
  28. use OCP\IConfig;
  29. use OCP\IL10N;
  30. use OCP\ILogger;
  31. use OCP\IURLGenerator;
  32. use OCP\IUser;
  33. use OCP\L10N\IFactory as L10NFactory;
  34. use Sabre\VObject\Component\VCalendar;
  35. use Test\TestCase;
  36. abstract class AbstractNotificationProviderTest extends TestCase {
  37. /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
  38. protected $logger;
  39. /** @var L10NFactory|\PHPUnit\Framework\MockObject\MockObject */
  40. protected $l10nFactory;
  41. /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
  42. protected $l10n;
  43. /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
  44. protected $urlGenerator;
  45. /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
  46. protected $config;
  47. /** @var AbstractProvider|\PHPUnit\Framework\MockObject\MockObject */
  48. protected $provider;
  49. /**
  50. * @var VCalendar
  51. */
  52. protected $vcalendar;
  53. /**
  54. * @var string
  55. */
  56. protected $calendarDisplayName;
  57. /**
  58. * @var IUser|\PHPUnit\Framework\MockObject\MockObject
  59. */
  60. protected $user;
  61. protected function setUp(): void {
  62. parent::setUp();
  63. $this->logger = $this->createMock(ILogger::class);
  64. $this->l10nFactory = $this->createMock(L10NFactory::class);
  65. $this->l10n = $this->createMock(IL10N::class);
  66. $this->urlGenerator = $this->createMock(IURLGenerator::class);
  67. $this->config = $this->createMock(IConfig::class);
  68. $this->vcalendar = new VCalendar();
  69. $this->vcalendar->add('VEVENT', [
  70. 'SUMMARY' => 'Fellowship meeting',
  71. 'DTSTART' => new \DateTime('2017-01-01 00:00:00+00:00'), // 1483228800,
  72. 'UID' => 'uid1234',
  73. ]);
  74. $this->calendarDisplayName = 'Personal';
  75. $this->user = $this->createMock(IUser::class);
  76. }
  77. }