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