|
|
|
@ -13,6 +13,7 @@ use OC\Calendar\AvailabilityResult;
|
|
|
|
use OC\Calendar\Manager;
|
|
|
|
use OC\Calendar\Manager;
|
|
|
|
use OCA\DAV\CalDAV\Auth\CustomPrincipalPlugin;
|
|
|
|
use OCA\DAV\CalDAV\Auth\CustomPrincipalPlugin;
|
|
|
|
use OCA\DAV\Connector\Sabre\Server;
|
|
|
|
use OCA\DAV\Connector\Sabre\Server;
|
|
|
|
|
|
|
|
use OCA\DAV\Db\PropertyMapper;
|
|
|
|
use OCA\DAV\ServerFactory;
|
|
|
|
use OCA\DAV\ServerFactory;
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
use OCP\Calendar\ICalendar;
|
|
|
|
use OCP\Calendar\ICalendar;
|
|
|
|
@ -61,6 +62,7 @@ class ManagerTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
|
|
private IUserManager&MockObject $userManager;
|
|
|
|
private IUserManager&MockObject $userManager;
|
|
|
|
private ServerFactory&MockObject $serverFactory;
|
|
|
|
private ServerFactory&MockObject $serverFactory;
|
|
|
|
|
|
|
|
private PropertyMapper&MockObject $propertyMapper;
|
|
|
|
|
|
|
|
|
|
|
|
private VCalendar $vCalendar1a;
|
|
|
|
private VCalendar $vCalendar1a;
|
|
|
|
private VCalendar $vCalendar2a;
|
|
|
|
private VCalendar $vCalendar2a;
|
|
|
|
@ -76,6 +78,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom = $this->createMock(ISecureRandom::class);
|
|
|
|
$this->secureRandom = $this->createMock(ISecureRandom::class);
|
|
|
|
$this->userManager = $this->createMock(IUserManager::class);
|
|
|
|
$this->userManager = $this->createMock(IUserManager::class);
|
|
|
|
$this->serverFactory = $this->createMock(ServerFactory::class);
|
|
|
|
$this->serverFactory = $this->createMock(ServerFactory::class);
|
|
|
|
|
|
|
|
$this->propertyMapper = $this->createMock(PropertyMapper::class);
|
|
|
|
|
|
|
|
|
|
|
|
$this->manager = new Manager(
|
|
|
|
$this->manager = new Manager(
|
|
|
|
$this->coordinator,
|
|
|
|
$this->coordinator,
|
|
|
|
@ -85,6 +88,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// construct calendar with a 1 hour event and same start/end time zones
|
|
|
|
// construct calendar with a 1 hour event and same start/end time zones
|
|
|
|
@ -328,6 +332,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -361,6 +366,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -395,6 +401,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -438,6 +445,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -480,6 +488,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->onlyMethods(['getCalendarsForPrincipal'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -527,6 +536,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -569,6 +579,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
@ -613,6 +624,7 @@ class ManagerTest extends TestCase {
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->userManager,
|
|
|
|
$this->userManager,
|
|
|
|
$this->serverFactory,
|
|
|
|
$this->serverFactory,
|
|
|
|
|
|
|
|
$this->propertyMapper,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->onlyMethods(['handleIMip'])
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
|