2019-03-16 18:19:25 +03:00
|
|
|
<?php
|
2019-12-03 21:57:53 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
declare(strict_types=1);
|
2019-12-03 21:57:53 +03:00
|
|
|
|
2019-03-16 18:19:25 +03:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2019, Thomas Citharel
|
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Georg Ehrke <oc.list@georgehrke.com>
|
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2019-03-16 18:19:25 +03:00
|
|
|
* @author Thomas Citharel <tcit@tcit.fr>
|
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* @license GNU AGPL version 3 or any later version
|
2019-03-16 18:19:25 +03:00
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
2019-03-16 18:19:25 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2019-12-03 21:57:53 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2019-03-16 18:19:25 +03:00
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2019-03-16 18:19:25 +03:00
|
|
|
*
|
|
|
|
*/
|
2019-11-22 22:52:10 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
namespace OCA\DAV\Tests\unit\CalDAV\Reminder\NotificationProvider;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
use OCA\DAV\CalDAV\Reminder\NotificationProvider\AbstractProvider;
|
2019-03-16 18:19:25 +03:00
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IL10N;
|
|
|
|
use OCP\ILogger;
|
|
|
|
use OCP\IURLGenerator;
|
|
|
|
use OCP\IUser;
|
2019-11-22 22:52:10 +03:00
|
|
|
use OCP\L10N\IFactory as L10NFactory;
|
2019-03-16 18:19:25 +03:00
|
|
|
use Sabre\VObject\Component\VCalendar;
|
2019-11-22 22:52:10 +03:00
|
|
|
use Test\TestCase;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
|
|
|
abstract class AbstractNotificationProviderTest extends TestCase {
|
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $logger;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var L10NFactory|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $l10nFactory;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $l10n;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $urlGenerator;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $config;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
/** @var AbstractProvider|\PHPUnit\Framework\MockObject\MockObject */
|
|
|
|
protected $provider;
|
2019-03-16 18:19:25 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var VCalendar
|
|
|
|
*/
|
|
|
|
protected $vcalendar;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $calendarDisplayName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var IUser|\PHPUnit\Framework\MockObject\MockObject
|
|
|
|
*/
|
|
|
|
protected $user;
|
|
|
|
|
2019-11-27 17:27:18 +03:00
|
|
|
protected function setUp(): void {
|
2019-03-16 18:19:25 +03:00
|
|
|
parent::setUp();
|
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
$this->logger = $this->createMock(ILogger::class);
|
|
|
|
$this->l10nFactory = $this->createMock(L10NFactory::class);
|
|
|
|
$this->l10n = $this->createMock(IL10N::class);
|
|
|
|
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
|
|
|
$this->config = $this->createMock(IConfig::class);
|
2019-03-16 18:19:25 +03:00
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
$this->vcalendar = new VCalendar();
|
2019-03-16 18:19:25 +03:00
|
|
|
$this->vcalendar->add('VEVENT', [
|
|
|
|
'SUMMARY' => 'Fellowship meeting',
|
2019-08-12 14:20:03 +03:00
|
|
|
'DTSTART' => new \DateTime('2017-01-01 00:00:00+00:00'), // 1483228800,
|
|
|
|
'UID' => 'uid1234',
|
|
|
|
]);
|
2019-03-16 18:19:25 +03:00
|
|
|
$this->calendarDisplayName = 'Personal';
|
|
|
|
|
2019-08-12 14:20:03 +03:00
|
|
|
$this->user = $this->createMock(IUser::class);
|
|
|
|
}
|
2019-03-16 18:19:25 +03:00
|
|
|
}
|