AbstractNotificationProviderTest.php 2.5 KB

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