Fix integration tests

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-11-11 13:44:57 +01:00
parent b5f1296d1f
commit 6047493b6d
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
3 changed files with 9 additions and 14 deletions

View File

@ -112,7 +112,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject(Extension::CALENDAR, $calendarData['id'])
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
->setType(Extension::CALENDAR)
->setAuthor($currentUser);
@ -162,7 +162,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject(Extension::CALENDAR, $calendarData['id'])
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
->setType(Extension::CALENDAR)
->setAuthor($currentUser);
@ -387,7 +387,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject(Extension::CALENDAR, $calendarData['id'])
->setObject(Extension::CALENDAR, (int) $calendarData['id'])
->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO)
->setAuthor($currentUser);

View File

@ -539,10 +539,13 @@ class Event implements IEvent {
$this->getAffectedUser() !== ''
&&
$this->getTimestamp() !== 0
/**
* Disabled for BC with old activities
&&
$this->getObjectType() !== ''
&&
$this->getObjectId() !== ''
$this->getObjectId() !== 0
*/
;
}
}

View File

@ -173,14 +173,6 @@ class Manager implements IManager {
* @throws \BadMethodCallException if required values have not been set
*/
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 ($this->session->getUser() instanceof IUser) {
$event->setAuthor($this->session->getUser()->getUID());
@ -191,7 +183,7 @@ class Manager implements IManager {
$event->setTimestamp(time());
}
if (!$legacyActivity && !$event->isValid()) {
if (!$event->isValid()) {
throw new \BadMethodCallException('The given event is invalid');
}
@ -222,7 +214,7 @@ class Manager implements IManager {
->setObject('', 0, $file)
->setLink($link);
$this->publishToConsumers($event, true);
$this->publish($event);
}
/**