Fix integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
b5f1296d1f
commit
6047493b6d
3 changed files with 9 additions and 14 deletions
|
@ -112,7 +112,7 @@ class Backend {
|
||||||
|
|
||||||
$event = $this->activityManager->generateEvent();
|
$event = $this->activityManager->generateEvent();
|
||||||
$event->setApp('dav')
|
$event->setApp('dav')
|
||||||
->setObject(Extension::CALENDAR, $calendarData['id'])
|
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
|
||||||
->setType(Extension::CALENDAR)
|
->setType(Extension::CALENDAR)
|
||||||
->setAuthor($currentUser);
|
->setAuthor($currentUser);
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class Backend {
|
||||||
|
|
||||||
$event = $this->activityManager->generateEvent();
|
$event = $this->activityManager->generateEvent();
|
||||||
$event->setApp('dav')
|
$event->setApp('dav')
|
||||||
->setObject(Extension::CALENDAR, $calendarData['id'])
|
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
|
||||||
->setType(Extension::CALENDAR)
|
->setType(Extension::CALENDAR)
|
||||||
->setAuthor($currentUser);
|
->setAuthor($currentUser);
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ class Backend {
|
||||||
|
|
||||||
$event = $this->activityManager->generateEvent();
|
$event = $this->activityManager->generateEvent();
|
||||||
$event->setApp('dav')
|
$event->setApp('dav')
|
||||||
->setObject(Extension::CALENDAR, $calendarData['id'])
|
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
|
||||||
->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO)
|
->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO)
|
||||||
->setAuthor($currentUser);
|
->setAuthor($currentUser);
|
||||||
|
|
||||||
|
|
|
@ -539,10 +539,13 @@ class Event implements IEvent {
|
||||||
$this->getAffectedUser() !== ''
|
$this->getAffectedUser() !== ''
|
||||||
&&
|
&&
|
||||||
$this->getTimestamp() !== 0
|
$this->getTimestamp() !== 0
|
||||||
|
/**
|
||||||
|
* Disabled for BC with old activities
|
||||||
&&
|
&&
|
||||||
$this->getObjectType() !== ''
|
$this->getObjectType() !== ''
|
||||||
&&
|
&&
|
||||||
$this->getObjectId() !== ''
|
$this->getObjectId() !== 0
|
||||||
|
*/
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,14 +173,6 @@ class Manager implements IManager {
|
||||||
* @throws \BadMethodCallException if required values have not been set
|
* @throws \BadMethodCallException if required values have not been set
|
||||||
*/
|
*/
|
||||||
public function publish(IEvent $event) {
|
public function publish(IEvent $event) {
|
||||||
$this->publishToConsumers($event, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param IEvent $event
|
|
||||||
* @param bool $legacyActivity
|
|
||||||
*/
|
|
||||||
protected function publishToConsumers(IEvent $event, $legacyActivity) {
|
|
||||||
if ($event->getAuthor() === '') {
|
if ($event->getAuthor() === '') {
|
||||||
if ($this->session->getUser() instanceof IUser) {
|
if ($this->session->getUser() instanceof IUser) {
|
||||||
$event->setAuthor($this->session->getUser()->getUID());
|
$event->setAuthor($this->session->getUser()->getUID());
|
||||||
|
@ -191,7 +183,7 @@ class Manager implements IManager {
|
||||||
$event->setTimestamp(time());
|
$event->setTimestamp(time());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$legacyActivity && !$event->isValid()) {
|
if (!$event->isValid()) {
|
||||||
throw new \BadMethodCallException('The given event is invalid');
|
throw new \BadMethodCallException('The given event is invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +214,7 @@ class Manager implements IManager {
|
||||||
->setObject('', 0, $file)
|
->setObject('', 0, $file)
|
||||||
->setLink($link);
|
->setLink($link);
|
||||||
|
|
||||||
$this->publishToConsumers($event, true);
|
$this->publish($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue