summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/pages/schedule/ImportSchedule.php1
-rw-r--r--src/Helpers/Schedule/Event.php8
-rw-r--r--tests/Unit/Helpers/Schedule/EventTest.php4
3 files changed, 13 insertions, 0 deletions
diff --git a/includes/pages/schedule/ImportSchedule.php b/includes/pages/schedule/ImportSchedule.php
index 1b03b57b..8bc769d4 100644
--- a/includes/pages/schedule/ImportSchedule.php
+++ b/includes/pages/schedule/ImportSchedule.php
@@ -440,6 +440,7 @@ class ImportSchedule extends BaseController
$event->getDate()->subMinutes($minutesBefore);
$event->getEndDate()->addMinutes($minutesAfter);
+ $event->setTitle(sprintf('%s [%s]', $event->getTitle(), $event->getLanguage()));
}
}
}
diff --git a/src/Helpers/Schedule/Event.php b/src/Helpers/Schedule/Event.php
index 46970e7b..ab3b39a5 100644
--- a/src/Helpers/Schedule/Event.php
+++ b/src/Helpers/Schedule/Event.php
@@ -184,6 +184,14 @@ class Event
}
/**
+ * @param string $title
+ */
+ public function setTitle(string $title): void
+ {
+ $this->title = $title;
+ }
+
+ /**
* @return string
*/
public function getSubtitle(): string
diff --git a/tests/Unit/Helpers/Schedule/EventTest.php b/tests/Unit/Helpers/Schedule/EventTest.php
index 262aeea7..d9706b13 100644
--- a/tests/Unit/Helpers/Schedule/EventTest.php
+++ b/tests/Unit/Helpers/Schedule/EventTest.php
@@ -84,6 +84,7 @@ class EventTest extends TestCase
* @covers \Engelsystem\Helpers\Schedule\Event::getId
* @covers \Engelsystem\Helpers\Schedule\Event::getRoom
* @covers \Engelsystem\Helpers\Schedule\Event::getTitle
+ * @covers \Engelsystem\Helpers\Schedule\Event::setTitle
* @covers \Engelsystem\Helpers\Schedule\Event::getSubtitle
* @covers \Engelsystem\Helpers\Schedule\Event::getType
* @covers \Engelsystem\Helpers\Schedule\Event::getDate
@@ -141,5 +142,8 @@ class EventTest extends TestCase
$this->assertEquals($attachments, $event->getAttachments());
$this->assertEquals('https://foo.bar/2-lorem', $event->getUrl());
$this->assertEquals('https://videos.orem.ipsum/2-lorem.mp4', $event->getVideoDownloadUrl());
+
+ $event->setTitle('Event title');
+ $this->assertEquals('Event title', $event->getTitle());
}
}